mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00: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');
|
$client_header = $this->getHeader('http-x-forwarded-for');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if($client_header !== null && filter_var($client_header, FILTER_VALIDATE_IP))
|
if($client_header === null)
|
||||||
return $client_header;
|
$client_header = $this->getHeader('remote-addr');
|
||||||
return $this->getHeader('remote-addr');
|
return filter_var($client_header, FILTER_VALIDATE_IP) ? $client_header : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user