Fixed "Your IP has been banned" alert on ban list not being displayed
Fixes #215
This commit is contained in:
parent
3704f427ad
commit
4ac20a09f7
10
src/bans.php
10
src/bans.php
|
@ -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()) {
|
||||||
|
|
Loading…
Reference in New Issue