Workaround for incorrect ISO-8859-5 encoded content conversion
This commit is contained in:
parent
24ae6c91ea
commit
32c4614a32
@ -228,8 +228,11 @@ class Linkinfo extends \Zotlabs\Web\Controller {
|
||||
|
||||
$header = $result['header'];
|
||||
$body = $result['body'];
|
||||
|
||||
$body = mb_convert_encoding($body, 'UTF-8', (preg_match('/meta.+content=["|\']text\/html;\s+charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'UTF-8'));
|
||||
|
||||
$cp = (preg_match('/meta.+content=["|\']text\/html;\s+charset=([^"|\']+)/i', $body, $o) ? $o[1] : 'AUTO');
|
||||
if(strtoupper($cp) == 'ISO-8859-5')
|
||||
$cp = 'AUTO';
|
||||
$body = mb_convert_encoding($body, 'UTF-8', $cp);
|
||||
$body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8");
|
||||
|
||||
$doc = new \DOMDocument();
|
||||
|
Reference in New Issue
Block a user