Fix empty entry Generator (#8863)

* Fix empty entry Generator
Fix https://github.com/FreshRSS/FreshRSS/issues/8857
Regression from https://github.com/FreshRSS/FreshRSS/pull/8789
This is due to https://bugs.php.net/bug.php?id=77515

* Use EmptyIterator instead

* Syntax update
This commit is contained in:
Alexandre Alapetite authored and GitHub committed 2026-05-19 21:45:20 +02:00
1 parent 02edc05035
commit c3fa374f25
2 files changed
+15 -10

No files matched your search

+3 -1
View File
@@ -118,7 +118,9 @@ $view = new FreshRSS_View();
try {
FreshRSS_Context::updateUsingRequest(false);
$view->entries = FreshRSS_index_Controller::listEntriesByContext();
$view->entries->current(); // Init the generator to consume the aggregated search and catch potential exceptions
if (!$view->entries->valid()) { // Init the generator to consume the aggregated search and catch potential exceptions
$view->entries = new EmptyIterator();
}
Minz_Request::_param('search', $userSearch->toString()); // Restore user search for display and exports
FreshRSS_Context::$search = $userSearch; // Restore user search for display and exports
} catch (Minz_Exception) {