From f45a1152bb246f823251b243c5dceeeca752a2ba Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 28 Jan 2017 14:24:48 +0300 Subject: [PATCH] af_readability: force utf8 preamble on html document load. no idea why but it seems to work better even for not-unicode sites. --- plugins/af_readability/init.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/af_readability/init.php b/plugins/af_readability/init.php index f89576e3..34bd99ae 100755 --- a/plugins/af_readability/init.php +++ b/plugins/af_readability/init.php @@ -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('\n' . $tmp)) return false; if (strtolower($tmpdoc->encoding) != 'utf-8') { -- 2.39.2