diff --git a/includes/session.php b/includes/session.php index 4666564..34a8204 100644 --- a/includes/session.php +++ b/includes/session.php @@ -281,6 +281,11 @@ class session // 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)) { + if(preg_match("#^::ffff:((?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5]))$#", $ip, $preg_matches)) + { + // keep only the IPv4 token and break + $this->ip = $preg_matches[1]; + } // Just break break; }