From: Andrew Dolgov Date: Tue, 6 Oct 2015 11:12:22 +0000 (+0300) Subject: limit maximum article length allowed for readability X-Git-Tag: 16.3~106 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4d03c5c59f29f5fa59c45150f5c14937e0355892;p=tt-rss.git limit maximum article length allowed for readability --- diff --git a/plugins/af_readability/init.php b/plugins/af_readability/init.php index 8914ba43..cfdcb69d 100644 --- a/plugins/af_readability/init.php +++ b/plugins/af_readability/init.php @@ -119,7 +119,7 @@ class Af_Readability extends Plugin { $tmp = fetch_file_contents($article["link"]); - if ($tmp) { + if ($tmp && mb_strlen($tmp) < 65535 * 4) { $tmpdoc = new DOMDocument("1.0", "UTF-8"); if (!$tmpdoc->loadHTML($tmp)) diff --git a/plugins/af_redditimgur/init.php b/plugins/af_redditimgur/init.php index 9b3a999d..ded98d8c 100644 --- a/plugins/af_redditimgur/init.php +++ b/plugins/af_redditimgur/init.php @@ -261,7 +261,10 @@ class Af_RedditImgur extends Plugin { $tmp = fetch_file_contents($content_link->getAttribute("href")); - if ($tmp) { + //_debug("tmplen: " . mb_strlen($tmp)); + + if ($tmp && mb_strlen($tmp) < 65535 * 4) { + $r = new Readability($tmp, $content_link->getAttribute("href")); if ($r->init()) {