From 7f9594b8c7d7799f2e5f89328bd5981410db8cf0 Mon Sep 17 00:00:00 2001 From: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com> Date: Fri, 7 Jul 2023 21:53:17 +0200 Subject: fix many "Only booleans are allowed in an if condition" (#5501) * fix many "Only booleans are allowed in an if condition" * Update cli/create-user.php Co-authored-by: Alexandre Alapetite * Update cli/i18n/I18nUsageValidator.php Co-authored-by: Alexandre Alapetite * Fix several regressions and other minor things * Fix another regression * Update lib/http-conditional.php Co-authored-by: Alexandre Alapetite --------- Co-authored-by: Luc Co-authored-by: Alexandre Alapetite --- cli/create-user.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/create-user.php') diff --git a/cli/create-user.php b/cli/create-user.php index 27e27f7a1..1da7f580d 100755 --- a/cli/create-user.php +++ b/cli/create-user.php @@ -10,7 +10,7 @@ if (!FreshRSS_user_Controller::checkUsername($username)) { } $usernames = listUsers(); -if (preg_grep("/^$username$/i", $usernames)) { +if (preg_grep("/^$username$/i", $usernames) !== false) { fail('FreshRSS warning: username already exists “' . $username . '”', EXIT_CODE_ALREADY_EXISTS); } @@ -31,7 +31,7 @@ if (!$ok) { if (!empty($options['api_password'])) { $username = cliInitUser($username); $error = FreshRSS_api_Controller::updatePassword($options['api_password']); - if ($error) { + if ($error !== false) { fail($error); } } -- cgit v1.2.3