From 30c7a61a9b410f023c56ef19b9389a61647d8768 Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Thu, 16 Nov 2023 22:43:00 +0100 Subject: Use strict_types (#5830) * Little's optimisations and booleans in conditions * Apply strict type * Apply strict type * Apply strict type * Fix multiple bugs with PHP 8.2 and 8.3 * Many declares missing, more errors fixed * Apply strict type * Another approach * Stronger typing for Minz_Session * Fix case of SQLite --------- Co-authored-by: Luc Co-authored-by: Alexandre Alapetite --- app/Models/Auth.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'app/Models/Auth.php') diff --git a/app/Models/Auth.php b/app/Models/Auth.php index 205b428a2..e5f7fc0b9 100644 --- a/app/Models/Auth.php +++ b/app/Models/Auth.php @@ -1,4 +1,5 @@ default_user; @@ -109,7 +110,7 @@ class FreshRSS_Auth { switch (FreshRSS_Context::$system_conf->auth_type) { case 'form': - self::$login_ok = Minz_Session::param('passwordHash') === FreshRSS_Context::$user_conf->passwordHash; + self::$login_ok = Minz_Session::paramString('passwordHash') === FreshRSS_Context::$user_conf->passwordHash; break; case 'http_auth': $current_user = Minz_User::name(); @@ -212,7 +213,7 @@ class FreshRSS_Auth { } public static function csrfToken(): string { - $csrf = Minz_Session::param('csrf'); + $csrf = Minz_Session::paramString('csrf'); if ($csrf == '') { $salt = FreshRSS_Context::$system_conf->salt; $csrf = sha1($salt . uniqid('' . random_int(0, mt_getrandmax()), true)); @@ -222,7 +223,7 @@ class FreshRSS_Auth { } public static function isCsrfOk(?string $token = null): bool { - $csrf = Minz_Session::param('csrf'); + $csrf = Minz_Session::paramString('csrf'); if ($token === null) { $token = $_POST['_csrf'] ?? ''; } -- cgit v1.2.3