diff options
| author | 2020-04-01 02:09:08 +0200 | |
|---|---|---|
| committer | 2020-04-01 02:09:08 +0200 | |
| commit | 656b61ff2956351538cc70fe79cc534b1eb58e0c (patch) | |
| tree | 445103013e333a4c4296f0bc19f4fdc9635c3b15 /app/Controllers/feedController.php | |
| parent | 5858aaf7fc4f4ebfe7cc4036d46a93397b06ccde (diff) | |
Fix fetch content for complex HEAD (#2867)
* Fix contentSelectorPreviewAction
Was not compatible with https://github.com/FreshRSS/FreshRSS/pull/2588
* Fix lib_phpQuery for <head ...>
#fix https://github.com/FreshRSS/FreshRSS/issues/2864
* Replace split() by explode() for PHP7 compatibility
https://php.net/str-split
* Fix for document with a `<head>` tag more complicated, like `<head
profile="http://www.w3.org/1999/xhtml/vocab">`
Diffstat (limited to 'app/Controllers/feedController.php')
| -rwxr-xr-x | app/Controllers/feedController.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php index 38aa09223..43a6b7287 100755 --- a/app/Controllers/feedController.php +++ b/app/Controllers/feedController.php @@ -753,14 +753,20 @@ class FreshRSS_feed_Controller extends Minz_ActionController { //Check Feed ID validity. $entryDAO = FreshRSS_Factory::createEntryDao(); $entries = $entryDAO->listWhere('f', $feed_id); + $entry = null; - if (empty($entries)) { + //Get first entry (syntax robust for Generator or Array) + foreach ($entries as $myEntry) { + $entry = $myEntry; + break; + } + + if ($entry == null) { $this->view->fatalError = _t('feedback.sub.feed.selector_preview.no_entries'); return; } - //Get feed & entry. - $entry = $entries[0]; + //Get feed. $feed = $entry->feed(true); if (!$feed) { |
