Skip to content

Commit

Permalink
Merge pull request #2521 from kprajapatii/master
Browse files Browse the repository at this point in the history
PHP Deprecated: mb_convert_encoding() - FIXED
  • Loading branch information
Stiofan authored Jan 23, 2024
2 parents 5e0f7bb + b66e646 commit 8d71fa0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
4 changes: 4 additions & 0 deletions includes/class-geodir-compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,10 @@ public static function astra_single_layout_one_banner_visibility( $value ) {
if ( $value && defined( 'ASTRA_THEME_VERSION' ) && version_compare( ASTRA_THEME_VERSION, '4.1', '>=' ) && ( geodir_is_page( 'post_type' ) || geodir_is_page( 'archive' ) || geodir_is_page( 'search' ) ) ) {
$gd_astra_41_fix = true;
$gd_skip_the_content = true;

if ( geodir_is_page( 'search' ) ) {
$value = false;
}
}

return $value;
Expand Down
14 changes: 8 additions & 6 deletions includes/libraries/class-emogrifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,12 @@ public function emogrify() {
$this->copyCssWithMediaToStyleNode($cssParts, $xmlDocument);

if ($this->preserveEncoding) {
if ( function_exists( 'mb_convert_encoding' ) ) {
// Deprecated since PHP 8.2
/*if ( function_exists( 'mb_convert_encoding' ) ) {
return mb_convert_encoding( $xmlDocument->saveHTML(), self::ENCODING, 'HTML-ENTITIES' );
} else {
} else {*/
return htmlspecialchars_decode( utf8_encode( html_entity_decode( $xmlDocument->saveHTML(), ENT_COMPAT, self::ENCODING ) ) );
}
//}
} else {
return $xmlDocument->saveHTML();
}
Expand Down Expand Up @@ -539,11 +540,12 @@ private function getUnifiedHtml() {
$bodyWithoutUnprocessableTags = $this->html;
}

if ( function_exists( 'mb_convert_encoding' ) ) {
// Deprecated since PHP 8.2
/*if ( function_exists( 'mb_convert_encoding' ) ) {
return mb_convert_encoding( $bodyWithoutUnprocessableTags, 'HTML-ENTITIES', self::ENCODING );
} else {
} else {*/
return htmlspecialchars_decode( utf8_decode( htmlentities( $bodyWithoutUnprocessableTags, ENT_COMPAT, self::ENCODING, false ) ) );
}
//}
}

/**
Expand Down
2 changes: 2 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ __WARNING: GDv2 is a significant update over GDv1 and may require manual work, s
* OSM layer url shows apikey parameter twice for custom style map - FIXED
* Listing ad shows incorrect rating stars on Divi builder template - FIXED
* Edit logo image title is not working on Chrome browser - FIXED
* PHP Deprecated: mb_convert_encoding() - FIXED
* Astra theme conflicts on search page - FIXED

= GeoDirectory v2.3.36 - 2024-01-09 =
* GD > Categories category text style not working for image design type - FIXED
Expand Down

0 comments on commit 8d71fa0

Please sign in to comment.