aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/Controllers')
-rw-r--r--app/Controllers/indexController.php4
-rw-r--r--app/Controllers/subscriptionController.php14
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') . ' · ');