diff options
| author | 2023-09-22 11:41:49 +0200 | |
|---|---|---|
| committer | 2023-09-22 11:41:49 +0200 | |
| commit | 662c9fcc2f5c6f2671b1b371c30990782a99b1a2 (patch) | |
| tree | a78c1abb75e0a511eddfc84daa2f8dfc27c04451 /cli/create-user.php | |
| parent | 2cb4f2e23352f6f3bd85ea790085380984ddb613 (diff) | |
fix: Fix check of existing usernames in cli scripts (#5667)
`preg_grep` returns an empty array if the username matches no elements
from the usernames array.
Regression introduced in 7f9594b8c7d7799f2e5f89328bd5981410db8cf0
Reference: https://github.com/FreshRSS/FreshRSS/pull/5501
Diffstat (limited to 'cli/create-user.php')
| -rwxr-xr-x | cli/create-user.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cli/create-user.php b/cli/create-user.php index 1da7f580d..c6364371a 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) !== false) { +if (preg_grep("/^$username$/i", $usernames)) { fail('FreshRSS warning: username already exists “' . $username . '”', EXIT_CODE_ALREADY_EXISTS); } |
