]> git.wh0rd.org - tt-rss.git/commitdiff
af_readability: force utf8 preamble on html document load. no idea why but it seems...
authorAndrew Dolgov <noreply@fakecake.org>
Sat, 28 Jan 2017 11:24:48 +0000 (14:24 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sat, 28 Jan 2017 11:24:48 +0000 (14:24 +0300)
plugins/af_readability/init.php

index f89576e3be10fcc13c0558bc6891e9baec0d59ac..34bd99ae006324f66527d641d2bd870fe6cbdd21 100755 (executable)
@@ -162,7 +162,7 @@ class Af_Readability extends Plugin {
                if ($tmp && mb_strlen($tmp) < 1024 * 500) {
                        $tmpdoc = new DOMDocument("1.0", "UTF-8");
 
-                       if (!$tmpdoc->loadHTML($tmp))
+                       if (!$tmpdoc->loadHTML('<?xml encoding="utf-8" ?>\n' . $tmp))
                                return false;
 
                        if (strtolower($tmpdoc->encoding) != 'utf-8') {