mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-10 10:20:52 +08:00
fix a user_can security problem
This commit is contained in:
@@ -1088,7 +1088,7 @@ function user_can($permission, $fail = false, $uid = 0): bool
|
||||
$uid = get_user_id();
|
||||
$log .= ", set current uid: $uid";
|
||||
}
|
||||
if ($uid <= 0) {
|
||||
if (!$fail && $uid <= 0) {
|
||||
do_log("$log, unauthenticated, false");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user