]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/commitdiff
be more specific in finding a user
authorValerie Pond <redacted>
Mon, 13 Mar 2023 18:12:05 +0000 (18:12 +0000)
committerValerie Pond <redacted>
Mon, 13 Mar 2023 18:12:05 +0000 (18:12 +0000)
take into account that $user can be `false` or `NULL`

Classes/class-paneluser.php

index 5e8fc2c57cd42f92b08172ad30c7f15a604da324..2cdc6c9f258363814ccf9310de916ec82167dcfb 100644 (file)
@@ -234,6 +234,8 @@ function unreal_get_current_user() : PanelUser|bool
 function current_user_can($permission) : bool
 {
        $user = unreal_get_current_user();
+       if (!$user)
+               return false;
        return user_can($user, $permission);
 }