Remove port from ipv4 addresses in auth.log.
This commit is contained in:
parent
b50bac6a3e
commit
333c4a381a
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue