use correct name for accessing the X-Real-IP header via $_SERVER variable (#365)
This commit is contained in:
parent
a69a70f5f4
commit
4f9e1a9342
|
@ -18,8 +18,8 @@ function getClientIp()
|
|||
{
|
||||
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
$ip = $_SERVER['HTTP_CLIENT_IP'];
|
||||
} elseif (!empty($_SERVER['X-Real-IP'])) {
|
||||
$ip = $_SERVER['X-Real-IP'];
|
||||
} elseif (!empty($_SERVER['HTTP_X_REAL_IP'])) {
|
||||
$ip = $_SERVER['HTTP_X_REAL_IP'];
|
||||
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
$ip = preg_replace('/,.*/', '', $ip); # hosts are comma-separated, client is first
|
||||
|
|
Loading…
Reference in a new issue