From 83b5944dcbb09db0accd528be4906b88590d924f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 17 May 2020 00:04:51 +0200 Subject: Stream instead of memory copy of SimplePie entries (#2972) * Stream instead of memory copy of SimplePie entries https://github.com/FreshRSS/FreshRSS/issues/2952 * Undo lines delete * Typo * Remove unaccessible code https://github.com/FreshRSS/FreshRSS/pull/2972/files#r425624163 * Back-compatibility for Feed->entries https://github.com/FreshRSS/FreshRSS/pull/2972/files#r425631913 --- app/Models/Entry.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'app/Models/Entry.php') diff --git a/app/Models/Entry.php b/app/Models/Entry.php index 584a16862..2ce44c73d 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -353,7 +353,6 @@ class FreshRSS_Entry extends Minz_Model { } public static function getContentByParsing($url, $path, $attributes = array()) { - require_once(LIB_PATH . '/lib_phpQuery.php'); $system_conf = Minz_Configuration::get('system'); $limits = $system_conf->limits; $feed_timeout = empty($attributes['timeout']) ? 0 : intval($attributes['timeout']); @@ -391,18 +390,9 @@ class FreshRSS_Entry extends Minz_Model { } if ($html) { + require_once(LIB_PATH . '/lib_phpQuery.php'); $doc = phpQuery::newDocument($html); $content = $doc->find($path); - - foreach (pq('img[data-src]') as $img) { - $imgP = pq($img); - $dataSrc = $imgP->attr('data-src'); - if (strlen($dataSrc) > 4) { - $imgP->attr('src', $dataSrc); - $imgP->removeAttr('data-src'); - } - } - return trim(sanitizeHTML($content->__toString(), $url)); } else { throw new Exception(); -- cgit v1.2.3