From 333c4a381a738048a44b74e64ff6392ce4c4b162 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Mon, 22 Jul 2024 02:17:00 -0700 Subject: [PATCH] Remove port from ipv4 addresses in auth.log. --- Rocksolid_Light/rocksolid/newsportal.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index 5904883..f86d1d8 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -1586,11 +1586,12 @@ function check_spam($subject, $from, $newsgroups, $ref, $body, $msgid, $useheade function logging_prefix($sockip = null) { global $client_ip_address; if($sockip) { - if(preg_match("/\[/", $sockip)) { + if(preg_match("/\./", $sockip)) { + $ipv4_addr = preg_split("/\:/", $sockip); + $client_ip = $ipv4_addr[0]; + } else { $ipv6_addr = explode("]", $sockip); $client_ip = substr($ipv6_addr[0], 1); - } else { - $client_ip = $sockip; } } else { $client_ip = $client_ip_address;