1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 22:10:45 +02:00

[ticket/9746] Ease up phpbb_ip_normalise() function.

PHPBB3-9746
This commit is contained in:
Andreas Fischer
2010-08-03 11:07:40 +02:00
parent 2aa54bb156
commit 985151913c

View File

@@ -3310,27 +3310,8 @@ function phpbb_ip_normalise($address)
{
return $address;
}
else if (preg_match(get_preg_expression('ipv6'), $address))
{
$address = phpbb_inet_ntop(phpbb_inet_pton($address));
if (strpos($address, '::ffff:') === 0)
{
// IPv4-mapped address
$address_ipv4 = substr($address, 7);
if (preg_match(get_preg_expression('ipv4'), $address_ipv4))
{
return $address_ipv4;
}
return false;
}
return $address;
}
return false;
return phpbb_inet_ntop(phpbb_inet_pton($address));
}
/**