bans.php - dont pass null into Utils::escape

This commit is contained in:
Wruczek 2020-10-06 04:26:04 +02:00
parent d0d9c91ab2
commit 9848c096e6
1 changed files with 13 additions and 9 deletions

View File

@ -33,10 +33,14 @@ if ($banlist !== null) {
// will just show the UID, IP or MyTSID
$target = "(unknown)";
$lastNickname = Utils::escape($ban["lastnickname"]);
$lastNickname = null;
$filter = "";
$abbreviation = null;
if ($ban["lastnickname"] !== null) {
$lastNickname = Utils::escape($ban["lastnickname"]);
}
if ($ban["ip"]) {
$ip = str_replace("\\", "", (string) $ban["ip"]);
@ -44,7 +48,7 @@ if ($banlist !== null) {
$ip = Utils::censorIpAddress($ip);
} catch (\Exception $e) {}
if ($lastNickname) {
if ($lastNickname !== null) {
$abbreviation = [$ip, "IP"];
} else {
$target = $ip;
@ -57,7 +61,7 @@ if ($banlist !== null) {
];
}
} else if ($ban["uid"]) {
if ($lastNickname) {
if ($lastNickname !== null) {
$abbreviation = [$ban["uid"], "UID"];
} else {
$target = new Html("<code>" . $ban["uid"] . "</code>");
@ -65,7 +69,7 @@ if ($banlist !== null) {
} else if ($ban["name"]) {
$target = $ban["name"];
} else if (!empty($ban["mytsid"])) { // empty, older TS servers dont have MYTS bans, so the key might not exist
if ($lastNickname) {
if ($lastNickname !== null) {
$abbreviation = [$ban["mytsid"], "MyTSID"];
} else {
$target = new Html("<code>" . $ban["mytsid"] . "</code>");