A free, self-hostable news aggregator…
Fix Minz_Error::error() -> use default values
Marien Fressinaud58deab37cdd9
diff --git a/app/Controllers/authController.php b/app/Controllers/authController.phpindex 491be8d8a..44496cd3e 100644--- a/app/Controllers/authController.php+++ b/app/Controllers/authController.php@@ -19,8 +19,7 @@ class FreshRSS_auth_Controller extends Minz_ActionController {*/public function indexAction() {if (!FreshRSS_Auth::hasAccess('admin')) {- Minz_Error::error(403,- array('error' => array(_t('access_denied'))));+ Minz_Error::error(403);}Minz_View::prependTitle(_t('gen.title.authentication') . ' · ');diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.phpindex 609284559..50b1d841a 100644--- a/app/Controllers/categoryController.php+++ b/app/Controllers/categoryController.php@@ -13,10 +13,7 @@ class FreshRSS_category_Controller extends Minz_ActionController {*/public function firstAction() {if (!FreshRSS_Auth::hasAccess()) {- Minz_Error::error(- 403,- array('error' => array(_t('access_denied')))- );+ Minz_Error::error(403);}$catDAO = new FreshRSS_CategoryDAO();diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.phpindex deb8cc849..1c8ac9111 100755--- a/app/Controllers/configureController.php+++ b/app/Controllers/configureController.php@@ -11,10 +11,7 @@ class FreshRSS_configure_Controller extends Minz_ActionController {*/public function firstAction() {if (!FreshRSS_Auth::hasAccess()) {- Minz_Error::error(- 403,- array('error' => array(_t('access_denied')))- );+ Minz_Error::error(403);}}diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.phpindex d11f3a520..b4beed619 100755--- a/app/Controllers/entryController.php+++ b/app/Controllers/entryController.php@@ -11,10 +11,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {*/public function firstAction() {if (!FreshRSS_Auth::hasAccess()) {- Minz_Error::error(- 403,- array('error' => array(_t('access_denied')))- );+ Minz_Error::error(403);}// If ajax request, we do not print layoutdiff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.phpindex 8563b1c0f..9990a852c 100755--- a/app/Controllers/feedController.php+++ b/app/Controllers/feedController.php@@ -20,10 +20,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {$action = Minz_Request::actionName();if ($action !== 'actualize' ||!(Minz_Configuration::allowAnonymousRefresh() || $token_is_ok)) {- Minz_Error::error(- 403,- array('error' => array(_t('access_denied')))- );+ Minz_Error::error(403);}}}@@ -442,10 +439,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {} else {Minz_Log::warning('Cannot move feed `' . $feed_id . '` ' .'in the category `' . $cat_id . '`');- Minz_Error::error(- 404,- array('error' => array(_t('error_occurred')))- );+ Minz_Error::error(404);}}diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.phpindex 8028af8ed..4e2dbd157 100644--- a/app/Controllers/importExportController.php+++ b/app/Controllers/importExportController.php@@ -11,10 +11,7 @@ class FreshRSS_importExport_Controller extends Minz_ActionController {*/public function firstAction() {if (!FreshRSS_Auth::hasAccess()) {- Minz_Error::error(- 403,- array('error' => array(_t('access_denied')))- );+ Minz_Error::error(403);}require_once(LIB_PATH . '/lib_opml.php');diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.phpindex 0e3430fcc..18fbca6df 100644--- a/app/Controllers/statsController.php+++ b/app/Controllers/statsController.php@@ -5,6 +5,19 @@*/class FreshRSS_stats_Controller extends Minz_ActionController {+ /**+ * This action is called before every other action in that class. It is+ * the common boiler plate for every action. It is triggered by the+ * underlying framework.+ */+ public function firstAction() {+ if (!FreshRSS_Auth::hasAccess()) {+ Minz_Error::error(403);+ }++ Minz_View::prependTitle(_t('stats') . ' · ');+ }+/*** This action handles the statistic main page.*@@ -111,20 +124,4 @@ class FreshRSS_stats_Controller extends Minz_ActionController {$this->view->repartitionMonth = $statsDAO->calculateEntryRepartitionPerFeedPerMonth($id);$this->view->averageMonth = $statsDAO->calculateEntryAveragePerFeedPerMonth($id);}-- /**- * This action is called before every other action in that class. It is- * the common boiler plate for every action. It is triggered by the- * underlying framework.- */- public function firstAction() {- if (!FreshRSS_Auth::hasAccess()) {- Minz_Error::error(- 403, array('error' => array(_t('access_denied')))- );- }-- Minz_View::prependTitle(_t('stats') . ' · ');- }-}diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.phpindex a89168eb3..67b95eba6 100644--- a/app/Controllers/subscriptionController.php+++ b/app/Controllers/subscriptionController.php@@ -11,10 +11,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {*/public function firstAction() {if (!FreshRSS_Auth::hasAccess()) {- Minz_Error::error(- 403,- array('error' => array(_t('access_denied')))- );+ Minz_Error::error(403);}$catDAO = new FreshRSS_CategoryDAO();@@ -71,10 +68,7 @@ class FreshRSS_subscription_Controller extends Minz_ActionController {$id = Minz_Request::param('id');if ($id === false || !isset($this->view->feeds[$id])) {- Minz_Error::error(- 404,- array('error' => array(_t('page_not_found')))- );+ Minz_Error::error(404);return;}diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.phpindex 4ef5357ea..0896b13ac 100644--- a/app/Controllers/updateController.php+++ b/app/Controllers/updateController.php@@ -4,10 +4,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {public function firstAction() {$current_user = Minz_Session::param('currentUser', '');if (!FreshRSS_Auth::hasAccess('admin')) {- Minz_Error::error(- 403,- array('error' => array(_t('access_denied')))- );+ Minz_Error::error(403);}invalidateHttpCache();diff --git a/app/Controllers/userController.php b/app/Controllers/userController.phpindex 39db1d879..5050571a9 100644--- a/app/Controllers/userController.php+++ b/app/Controllers/userController.php@@ -15,10 +15,7 @@ class FreshRSS_user_Controller extends Minz_ActionController {*/public function firstAction() {if (!FreshRSS_Auth::hasAccess()) {- Minz_Error::error(- 403,- array('error' => array(_t('access_denied')))- );+ Minz_Error::error(403);}}@@ -88,8 +85,7 @@ class FreshRSS_user_Controller extends Minz_ActionController {*/public function manageAction() {if (!FreshRSS_Auth::hasAccess('admin')) {- Minz_Error::error(403,- array('error' => array(_t('access_denied'))));+ Minz_Error::error(403);}Minz_View::prependTitle(_t('gen.title.user_management') . ' · ');