diff options
| author | 2024-12-28 23:58:00 +0100 | |
|---|---|---|
| committer | 2024-12-28 23:58:00 +0100 | |
| commit | c29cbb7b8be95fee249ed1a21dce98a4772d92e2 (patch) | |
| tree | b116f6033ea081c6cc5f82ce83156f2a7021166c /app/Controllers | |
| parent | 33cdfbb309c61167cf1c81273eb242f94ca8f996 (diff) | |
Fix regressions on some array structures (#7155)
regressions from https://github.com/FreshRSS/FreshRSS/pull/7131
fix https://github.com/FreshRSS/FreshRSS/issues/7154
Diffstat (limited to 'app/Controllers')
| -rw-r--r-- | app/Controllers/indexController.php | 4 | ||||
| -rw-r--r-- | app/Controllers/subscriptionController.php | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index fffc15b2a..3737f2dfd 100644 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -218,7 +218,7 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController { Minz_Error::error(404); return; } - $this->view->categories = [ $cat ]; + $this->view->categories = [$cat->id() => $cat]; break; case 'f': // We most likely already have the feed object in cache @@ -231,7 +231,7 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController { return; } } - $this->view->feeds = [ $feed ]; + $this->view->feeds = [$feed->id() => $feed]; break; case 's': case 't': diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index b1b999a4a..ef2bbed6e 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -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') . ' · '); |
