Convert non UTF-8 content on link embeding

This commit is contained in:
Max Kostikov 2018-10-23 19:32:36 +02:00
parent 01e11e9043
commit f180558041

View File

@ -228,8 +228,10 @@ class Linkinfo extends \Zotlabs\Web\Controller {
$header = $result['header'];
$body = $result['body'];
$body = mb_convert_encoding($body, 'UTF-8', 'UTF-8');
$x = preg_match('/<meta\s+http-equiv=.content-type.+; charset=([^"|\']+)/i', $body, $o);
$body = mb_convert_encoding($body, 'UTF-8', ($o[1] ? $o[1] : 'UTF-8'));
$body = mb_convert_encoding($body, 'HTML-ENTITIES', "UTF-8");
$doc = new \DOMDocument();