mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/9746] Ease up phpbb_ip_normalise() function.
PHPBB3-9746
This commit is contained in:
parent
2aa54bb156
commit
985151913c
1 changed files with 1 additions and 20 deletions
|
@ -3310,27 +3310,8 @@ function phpbb_ip_normalise($address)
|
||||||
{
|
{
|
||||||
return $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)
|
return phpbb_inet_ntop(phpbb_inet_pton($address));
|
||||||
{
|
|
||||||
// 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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue