aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-10-27 21:45:30 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-10-27 21:45:30 +0100
commitc6f35ef51c2c536efb4f8e73603ae46b8512cc24 (patch)
treec5698ae0abd10e19730f44c287689746153d9345 /app/Controllers/feedController.php
parent299495d0820dd6a8c26842264a3b15b95884b9fb (diff)
Global limits for number of feeds and categories
New 'limits' sub-array in config.php with 'max_feeds' and 'max_categories'. If the values are < 0, then it is the default value (16384). https://github.com/marienfressinaud/FreshRSS/issues/680
Diffstat (limited to 'app/Controllers/feedController.php')
-rwxr-xr-xapp/Controllers/feedController.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index c2859edf4..39e4b5761 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -68,6 +68,13 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
'params' => array(),
);
+ $limits = Minz_Configuration::limits();
+ $this->view->feeds = $feedDAO->listFeeds();
+ if (count($this->view->feeds) >= $limits['max_feeds']) {
+ Minz_Request::bad(_t('over_max_feeds', $limits['max_feeds']), $url_redirect);
+ return;
+ }
+
if (Minz_Request::isPost()) {
@set_time_limit(300);