aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2010-07-22 00:59:12 +0200
committerAndreas Fischer <bantu@phpbb.com>2011-01-03 00:09:51 +0100
commit6a32724400e2647096d1bd124a4697d625652c02 (patch)
treedca7b64d4e17bc342393cd7076f44f951b2ee025
parent8032549a15609b48d0a0daf08bd541582126a4c4 (diff)
downloadforums-6a32724400e2647096d1bd124a4697d625652c02.tar
forums-6a32724400e2647096d1bd124a4697d625652c02.tar.gz
forums-6a32724400e2647096d1bd124a4697d625652c02.tar.bz2
forums-6a32724400e2647096d1bd124a4697d625652c02.tar.xz
forums-6a32724400e2647096d1bd124a4697d625652c02.zip
[ticket/9746] Adding calls to phpbb_ip_normalise() from session management.
PHPBB3-9746
-rw-r--r--phpBB/includes/session.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index 0f1b1314c2..c4cc17d2a4 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -279,6 +279,24 @@ class session
foreach ($ips as $ip)
{
+ if (function_exists('phpbb_ip_normalise'))
+ {
+ // Normalise IP address
+ $ip = phpbb_ip_normalise($ip);
+
+ if (empty($ip))
+ {
+ // IP address is invalid.
+ break;
+ }
+
+ // IP address is valid.
+ $this->ip = $ip;
+
+ // Skip legacy code.
+ continue;
+ }
+
// check IPv4 first, the IPv6 is hopefully only going to be used very seldomly
if (!empty($ip) && !preg_match(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip))
{