mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-29 06:38:52 +00:00
[ticket/9746] Adding calls to phpbb_ip_normalise() from session management.
PHPBB3-9746
This commit is contained in:
parent
8032549a15
commit
6a32724400
1 changed files with 18 additions and 0 deletions
|
@ -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))
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue