Skip to content

Commit

Permalink
fix mb_convert_encoding deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafauysal committed Mar 18, 2024
1 parent 6fbcf96 commit 5d21db8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions includes/notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ function prepare_notification_info() {

$notification_content = ( isset( $notification['content'] ) ? $notification['content'] : '' );

if ( function_exists( 'mb_convert_encoding' ) ) { // convert multibyte strings
$notification_content = mb_convert_encoding( $notification_content, 'HTML-ENTITIES', 'UTF-8' );
if ( function_exists( 'mb_encode_numericentity' ) ) {
$convmap = array( 0x80, 0x10ffff, 0, 0xffffff ); // Range of characters to convert
$notification_content = mb_encode_numericentity( $notification_content, $convmap, 'UTF-8' );
}

if ( empty( $notification_content ) ) {
Expand Down

0 comments on commit 5d21db8

Please sign in to comment.