mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-15 18:23:26 +03:00
also check remote-addr (can be edited https://stackoverflow.com/questions/5092563/how-to-fake-serverremote-addr-variable)
This commit is contained in:
@@ -175,9 +175,9 @@ class Request
|
||||
$client_header = $this->getHeader('http-x-forwarded-for');
|
||||
}
|
||||
}
|
||||
if($client_header !== null && filter_var($client_header, FILTER_VALIDATE_IP))
|
||||
return $client_header;
|
||||
return $this->getHeader('remote-addr');
|
||||
if($client_header === null)
|
||||
$client_header = $this->getHeader('remote-addr');
|
||||
return filter_var($client_header, FILTER_VALIDATE_IP) ? $client_header : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user