diff options
author | Andrew Dolgov <[email protected]> | 2019-03-21 21:08:02 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2019-03-21 21:08:02 +0300 |
commit | 671f4cee657f36881eeeea7e5d314034252e3ee7 (patch) | |
tree | 2dc84b4a15b591e94366b37f39418f6e70a8e593 /classes/rssutils.php | |
parent | 3bd3324e5a9171e6cca20b44d1569da41a1d4874 (diff) |
domdocument: remove old meta charset unicode hacks, replace with shorter xml preamble utf8 hack (on loadhtml where it makes sense)
af_readability: better (?) charset hack for non-unicode pages
Diffstat (limited to 'classes/rssutils.php')
-rwxr-xr-x | classes/rssutils.php | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/classes/rssutils.php b/classes/rssutils.php index 82a6963e8..5aff2f8a3 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -1200,12 +1200,8 @@ class RSSUtils { static function cache_media($html, $site_url) { libxml_use_internal_errors(true); - $charset_hack = '<head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> - </head>'; - $doc = new DOMDocument(); - $doc->loadHTML($charset_hack . $html); + $doc->loadHTML('<?xml encoding="UTF-8">' . $html); $xpath = new DOMXPath($doc); $entries = $xpath->query('(//img[@src])|(//video/source[@src])|(//audio/source[@src])'); |