diff options
| author | 2020-05-17 00:04:51 +0200 | |
|---|---|---|
| committer | 2020-05-17 00:04:51 +0200 | |
| commit | 83b5944dcbb09db0accd528be4906b88590d924f (patch) | |
| tree | 78d171edbdb96e898723f20f09274818b5f97f82 /app/Models/Entry.php | |
| parent | 525e1ca0b0b9e2aaf9e8c2450ceb0a1a20dd71b7 (diff) | |
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
Diffstat (limited to 'app/Models/Entry.php')
| -rw-r--r-- | app/Models/Entry.php | 12 |
1 files changed, 1 insertions, 11 deletions
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(); |
