Fix regressions on some array structures (#7155)

regressions from https://github.com/FreshRSS/FreshRSS/pull/7131
fix https://github.com/FreshRSS/FreshRSS/issues/7154
This commit is contained in:
Alexandre Alapetite
2024-12-28 23:58:00 +01:00
committed by GitHub
parent 33cdfbb309
commit c29cbb7b8b
15 changed files with 88 additions and 71 deletions

View File

@@ -93,16 +93,18 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController {
FreshRSS_View::appendScript(Minz_Url::display('/scripts/feed.js?' . @filemtime(PUBLIC_PATH . '/scripts/feed.js')));
}
$feedDAO = FreshRSS_Factory::createFeedDao();
$this->view->feeds = $feedDAO->listFeeds();
$id = Minz_Request::paramInt('id');
if ($id === 0 || !isset($this->view->feeds[$id])) {
Minz_Error::error(404);
if ($id === 0) {
Minz_Error::error(400);
return;
}
$feed = $this->view->feeds[$id];
$feedDAO = FreshRSS_Factory::createFeedDao();
$feed = $feedDAO->searchById($id);
if ($feed === null) {
Minz_Error::error(404);
return;
}
$this->view->feed = $feed;
FreshRSS_View::prependTitle($feed->name() . ' · ' . _t('sub.title.feed_management') . ' · ');