Merge pull request #7379 from a3rev/master

Add code to check if mb_convert_encoding function is exsited then can called it for emogrifier lib
This commit is contained in:
Mike Jolley 2015-02-12 11:09:45 +00:00
commit 891016df28
1 changed files with 4 additions and 2 deletions

View File

@ -352,7 +352,8 @@ class Emogrifier {
$this->copyCssWithMediaToStyleNode($cssParts, $xmlDocument); $this->copyCssWithMediaToStyleNode($cssParts, $xmlDocument);
if ($this->preserveEncoding) { 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 { } else {
return $xmlDocument->saveHTML(); return $xmlDocument->saveHTML();
} }
@ -536,7 +537,8 @@ class Emogrifier {
$bodyWithoutUnprocessableTags = $this->html; $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; }
} }
/** /**