mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge branch 'ticket/bantu/9091' into develop-olympus
* ticket/bantu/9091: [ticket/9091] Extract IPv4 address from addresses mapped into IPv6.
This commit is contained in:
@@ -285,6 +285,17 @@ class session
|
||||
break;
|
||||
}
|
||||
|
||||
// Quick check for IPv4-mapped address in IPv6
|
||||
if (stripos($ip, '::ffff:') === 0)
|
||||
{
|
||||
$ipv4 = substr($ip, 7);
|
||||
|
||||
if (preg_match(get_preg_expression('ipv4'), $ipv4))
|
||||
{
|
||||
$ip = $ipv4;
|
||||
}
|
||||
}
|
||||
|
||||
// Use the last in chain
|
||||
$this->ip = $ip;
|
||||
}
|
||||
|
Reference in New Issue
Block a user