diff --git a/include/globalfunctions.php b/include/globalfunctions.php index 7a4c9e9e..7abf6fda 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -49,7 +49,7 @@ function validip($ip) else return false; } -function getip() { +function getip($true = true) { if (isset($_SERVER)) { if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && validip($_SERVER['HTTP_X_FORWARDED_FOR'])) { $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; @@ -67,7 +67,9 @@ function getip() { $ip = getenv('REMOTE_ADDR') ?? ''; } } - + if ($true) { + return strstr($ip, ",", true); + } return $ip; }