Merget getIP.php with master

This commit is contained in:
adolfintel 2018-10-20 06:56:26 +02:00
parent 5f19caf402
commit 3f6210cee7

View file

@ -15,6 +15,7 @@ if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['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
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}