From 662c9fcc2f5c6f2671b1b371c30990782a99b1a2 Mon Sep 17 00:00:00 2001 From: berumuron Date: Fri, 22 Sep 2023 11:41:49 +0200 Subject: 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 --- cli/delete-user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/delete-user.php') diff --git a/cli/delete-user.php b/cli/delete-user.php index 7b05cbe7a..fbbb2eebb 100755 --- a/cli/delete-user.php +++ b/cli/delete-user.php @@ -19,7 +19,7 @@ if (!FreshRSS_user_Controller::checkUsername($username)) { } $usernames = listUsers(); -if (preg_grep("/^$username$/i", $usernames) === false) { +if (!preg_grep("/^$username$/i", $usernames)) { fail('FreshRSS error: username not found “' . $username . '”'); } -- cgit v1.2.3