From 2038d50110468d95ff978ba2e8f997175f25ff3b Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Mon, 15 May 2023 19:26:48 +0200 Subject: PHPStan Level 7 for Minz_Request, FreshRSS_Feed, Minz_Error (#5400) * PHPStan Level 7 for Minz_Request * PHPStan Level 7 for FreshRSS_Feed * PHPStan Level 7 for Minz_Error --- app/Controllers/authController.php | 4 ++-- app/Controllers/userController.php | 11 ++--------- 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'app/Controllers') diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php index 54935ab1b..0839656a5 100644 --- a/app/Controllers/authController.php +++ b/app/Controllers/authController.php @@ -126,13 +126,13 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController { if (FreshRSS_Context::$user_conf == null) { // Initialise the default user to be able to display the error page FreshRSS_Context::initUser(FreshRSS_Context::$system_conf->default_user); - Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false); + Minz_Error::error(403, _t('feedback.auth.login.invalid'), false); return; } if (!FreshRSS_Context::$user_conf->enabled || FreshRSS_Context::$user_conf->passwordHash == '') { usleep(random_int(100, 5000)); //Primitive mitigation of timing attacks, in μs - Minz_Error::error(403, array(_t('feedback.auth.login.invalid')), false); + Minz_Error::error(403, _t('feedback.auth.login.invalid'), false); return; } diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index f929fc779..9906ae6bd 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -278,7 +278,6 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { * - r (i.e. a redirection url, optional) * * @todo clean up this method. Idea: write a method to init a user with basic information. - * @todo handle r redirection in Minz_Request::forward directly? */ public function createAction(): void { if (!FreshRSS_Auth::hasAccess('admin') && max_registrations_reached()) { @@ -372,10 +371,7 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { } } - $redirect_url = urldecode(Minz_Request::paramString('r', true)); - if ($redirect_url === '') { - $redirect_url = ['c' => 'user', 'a' => 'manage']; - } + $redirect_url = ['c' => 'user', 'a' => 'manage']; Minz_Request::forward($redirect_url, true); } @@ -534,10 +530,7 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { Minz_Error::error(403); } - $redirect_url = urldecode(Minz_Request::paramString('r', true)); - if ($redirect_url === '') { - $redirect_url = ['c' => 'user', 'a' => 'manage']; - } + $redirect_url = ['c' => 'user', 'a' => 'manage']; if (Minz_Request::isPost()) { $ok = true; -- cgit v1.2.3