mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 12:07:23 +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();
|
$uid = get_user_id();
|
||||||
$log .= ", set current uid: $uid";
|
$log .= ", set current uid: $uid";
|
||||||
}
|
}
|
||||||
if ($uid <= 0) {
|
if (!$fail && $uid <= 0) {
|
||||||
do_log("$log, unauthenticated, false");
|
do_log("$log, unauthenticated, false");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user