From 013724917538c70a7e6bc39509f1034ad9cfee4e Mon Sep 17 00:00:00 2001 From: a3rev Date: Thu, 12 Feb 2015 12:38:50 +0700 Subject: [PATCH] Add code to check if mb_convert_encoding function is exsited then can called it for emogrifier lib --- includes/libraries/class-emogrifier.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/libraries/class-emogrifier.php b/includes/libraries/class-emogrifier.php index 97ed1d34dd7..687dc10ec71 100644 --- a/includes/libraries/class-emogrifier.php +++ b/includes/libraries/class-emogrifier.php @@ -352,7 +352,8 @@ class Emogrifier { $this->copyCssWithMediaToStyleNode($cssParts, $xmlDocument); if ($this->preserveEncoding) { - return mb_convert_encoding($xmlDocument->saveHTML(), self::ENCODING, 'HTML-ENTITIES'); + if ( function_exists('mb_convert_encoding') ) { return mb_convert_encoding($xmlDocument->saveHTML(), self::ENCODING, 'HTML-ENTITIES'); } + else { return $xmlDocument->saveHTML(); } } else { return $xmlDocument->saveHTML(); } @@ -536,7 +537,8 @@ class Emogrifier { $bodyWithoutUnprocessableTags = $this->html; } - return mb_convert_encoding($bodyWithoutUnprocessableTags, 'HTML-ENTITIES', self::ENCODING); + if ( function_exists('mb_convert_encoding') ) { return mb_convert_encoding($bodyWithoutUnprocessableTags, 'HTML-ENTITIES', self::ENCODING); } + else { return $bodyWithoutUnprocessableTags; } } /**