Fixed "Your IP has been banned" alert on ban list not being displayed

Fixes #215
This commit is contained in:
Wruczek 2022-12-14 01:37:19 +01:00
parent 3704f427ad
commit 4ac20a09f7
1 changed files with 6 additions and 4 deletions

View File

@ -45,13 +45,15 @@ if ($banlist !== null) {
$ip = str_replace("\\", "", (string) $ban["ip"]); $ip = str_replace("\\", "", (string) $ban["ip"]);
try { try {
$ip = Utils::censorIpAddress($ip); $ipCensored = Utils::censorIpAddress($ip);
} catch (\Exception $e) {} } catch (\Exception $e) {
$ipCensored = "error"; // if not an IP - should not happen
}
if ($lastNickname !== null) { if ($lastNickname !== null) {
$abbreviation = [$ip, "IP"]; $abbreviation = [$ipCensored, "IP"];
} else { } else {
$target = $ip; $target = $ipCensored;
} }
if ($ip === Utils::getClientIp()) { if ($ip === Utils::getClientIp()) {