diff options
author | Andreas Fischer <bantu@phpbb.com> | 2010-07-23 12:48:01 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2010-07-23 12:48:01 +0200 |
commit | e5d5d581727ce61e653fdfc9a30effb69799aac5 (patch) | |
tree | b617619946adb521817d602a09d491cbbe8e0989 /phpBB/includes | |
parent | fc25fe694afdab683789c9ed962c77558f85796c (diff) | |
download | forums-e5d5d581727ce61e653fdfc9a30effb69799aac5.tar forums-e5d5d581727ce61e653fdfc9a30effb69799aac5.tar.gz forums-e5d5d581727ce61e653fdfc9a30effb69799aac5.tar.bz2 forums-e5d5d581727ce61e653fdfc9a30effb69799aac5.tar.xz forums-e5d5d581727ce61e653fdfc9a30effb69799aac5.zip |
[ticket/9091] Extract IPv4 address from addresses mapped into IPv6.
PHPBB3-9091
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/session.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index e157053e61..2ee9365631 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -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; } |