fix(user): 500 if logged in as admin and when user was previously banned permanently

This commit is contained in:
veselcraft 2025-01-22 17:30:09 +03:00
parent 3afb44fd89
commit 24b8d6f7f1
No known key found for this signature in database
GPG key ID: 9CF0B42766CCF7BA

View file

@ -1303,7 +1303,7 @@ class User extends RowModel
$last_ban = end($bans);
if (!$last_ban) return 0;
if ($last_ban->isPermanent()) return "permanent";
if ($last_ban->isPermanent()) return "0";
$values = [0, 3600, 7200, 86400, 172800, 604800, 1209600, 3024000, 9072000];
$response = 0;
@ -1317,7 +1317,7 @@ class User extends RowModel
break;
} else if ($last_ban->getTime() >= $value) {
if ($i < count($values)) continue;
$response = "permanent";
$response = "0";
break;
}
}