limit maximum article length allowed for readability
This commit is contained in:
parent
86d07d367c
commit
4d03c5c59f
|
@ -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))
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Reference in New Issue