mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/9802] Remove redundant character class definition from preg_replace.
PHPBB3-9802
This commit is contained in:
parent
ee6167879e
commit
fd80535859
1 changed files with 2 additions and 2 deletions
|
@ -221,7 +221,7 @@ class session
|
||||||
// if the forwarded for header shall be checked we have to validate its contents
|
// if the forwarded for header shall be checked we have to validate its contents
|
||||||
if ($config['forwarded_for_check'])
|
if ($config['forwarded_for_check'])
|
||||||
{
|
{
|
||||||
$this->forwarded_for = preg_replace('#[ ]{2,}#', ' ', str_replace(',', ' ', $this->forwarded_for));
|
$this->forwarded_for = preg_replace('# {2,}#', ' ', str_replace(',', ' ', $this->forwarded_for));
|
||||||
|
|
||||||
// split the list of IPs
|
// split the list of IPs
|
||||||
$ips = explode(' ', $this->forwarded_for);
|
$ips = explode(' ', $this->forwarded_for);
|
||||||
|
@ -268,7 +268,7 @@ class session
|
||||||
// Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests
|
// Why no forwarded_for et al? Well, too easily spoofed. With the results of my recent requests
|
||||||
// it's pretty clear that in the majority of cases you'll at least be left with a proxy/cache ip.
|
// it's pretty clear that in the majority of cases you'll at least be left with a proxy/cache ip.
|
||||||
$this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars((string) $_SERVER['REMOTE_ADDR']) : '';
|
$this->ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars((string) $_SERVER['REMOTE_ADDR']) : '';
|
||||||
$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(' ', $this->ip);
|
||||||
|
|
Loading…
Add table
Reference in a new issue