From 4ac20a09f700c5da8763387b22010dbb260008f1 Mon Sep 17 00:00:00 2001 From: Wruczek Date: Wed, 14 Dec 2022 01:37:19 +0100 Subject: [PATCH] Fixed "Your IP has been banned" alert on ban list not being displayed Fixes #215 --- src/bans.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/bans.php b/src/bans.php index b5339b4..93c7d4f 100644 --- a/src/bans.php +++ b/src/bans.php @@ -45,13 +45,15 @@ if ($banlist !== null) { $ip = str_replace("\\", "", (string) $ban["ip"]); try { - $ip = Utils::censorIpAddress($ip); - } catch (\Exception $e) {} + $ipCensored = Utils::censorIpAddress($ip); + } catch (\Exception $e) { + $ipCensored = "error"; // if not an IP - should not happen + } if ($lastNickname !== null) { - $abbreviation = [$ip, "IP"]; + $abbreviation = [$ipCensored, "IP"]; } else { - $target = $ip; + $target = $ipCensored; } if ($ip === Utils::getClientIp()) {