mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
getip() param name use real
This commit is contained in:
@@ -49,7 +49,7 @@ function validip($ip)
|
|||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getip($true = true) {
|
function getip($real = true) {
|
||||||
if (isset($_SERVER)) {
|
if (isset($_SERVER)) {
|
||||||
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && validip($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && validip($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||||
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||||
@@ -67,7 +67,7 @@ function getip($true = true) {
|
|||||||
$ip = getenv('REMOTE_ADDR') ?? '';
|
$ip = getenv('REMOTE_ADDR') ?? '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($true) {
|
if ($real) {
|
||||||
return strstr($ip, ",", true);
|
return strstr($ip, ",", true);
|
||||||
}
|
}
|
||||||
return $ip;
|
return $ip;
|
||||||
|
|||||||
Reference in New Issue
Block a user