aboutsummaryrefslogtreecommitdiff
path: root/cli/_cli.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2021-08-14 12:22:42 +0200
committerGravatar GitHub <noreply@github.com> 2021-08-14 12:22:42 +0200
commit7d83321286efc37162521f4302cf17f03c317020 (patch)
tree4306a63572b04de0bc94e4ced0fff3d0c23866ed /cli/_cli.php
parent92ae9c89a4356abc94f2ec5c96a1b783f933fb18 (diff)
Better catch when a user does not exists (#3751)
#fix https://github.com/FreshRSS/FreshRSS/issues/3735 Before, we were relying on an exception during the first stages of user initalisation. Now the check is explicit and cleaner, producing a more appropriate HTTP response for the API.
Diffstat (limited to 'cli/_cli.php')
-rw-r--r--cli/_cli.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/cli/_cli.php b/cli/_cli.php
index ed884bbb6..10a92385a 100644
--- a/cli/_cli.php
+++ b/cli/_cli.php
@@ -28,8 +28,7 @@ function cliInitUser($username) {
fail('FreshRSS error: invalid username: ' . $username . "\n");
}
- $usernames = listUsers();
- if (!in_array($username, $usernames)) {
+ if (!FreshRSS_user_Controller::userExists($username)) {
fail('FreshRSS error: user not found: ' . $username . "\n");
}