mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/9802] Fix tiny logic bug in loop determining REMOTE_ADDR.
When $ip is empty() it was assigned to $this->ip. PHPBB3-9802
This commit is contained in:
parent
fd80535859
commit
bef2540d9c
1 changed files with 2 additions and 2 deletions
|
@ -271,7 +271,7 @@ class session
|
||||||
$this->ip = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $this->ip));
|
$this->ip = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $this->ip));
|
||||||
|
|
||||||
// split the list of IPs
|
// split the list of IPs
|
||||||
$ips = explode(' ', $this->ip);
|
$ips = explode(' ', trim($this->ip));
|
||||||
|
|
||||||
// Default IP if REMOTE_ADDR is invalid
|
// Default IP if REMOTE_ADDR is invalid
|
||||||
$this->ip = '127.0.0.1';
|
$this->ip = '127.0.0.1';
|
||||||
|
@ -279,7 +279,7 @@ class session
|
||||||
foreach ($ips as $ip)
|
foreach ($ips as $ip)
|
||||||
{
|
{
|
||||||
// check IPv4 first, the IPv6 is hopefully only going to be used very seldomly
|
// 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(get_preg_expression('ipv4'), $ip) && !preg_match(get_preg_expression('ipv6'), $ip))
|
||||||
{
|
{
|
||||||
// Just break
|
// Just break
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue