Skip to content

Commit

Permalink
Update Lib.php
Browse files Browse the repository at this point in the history
  • Loading branch information
dfridrich committed Jul 11, 2021
1 parent e613d41 commit f00e4be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ public static function getIp()
if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',') !== false) {
$iplist = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
foreach ($iplist as $ip) {
if (validate_ip($ip)) {
if (self::validateIp($ip)) {
return $ip;
}
}
} else {
if (validate_ip($_SERVER['HTTP_X_FORWARDED_FOR'])) {
if (self::validateIp($_SERVER['HTTP_X_FORWARDED_FOR'])) {
return $_SERVER['HTTP_X_FORWARDED_FOR'];
}
}
Expand All @@ -92,7 +92,7 @@ public static function getIp()
}

// Return unreliable IP address since all else failed
return $_SERVER['REMOTE_ADDR'];
return @$_SERVER['REMOTE_ADDR'];
}

/**
Expand Down

0 comments on commit f00e4be

Please sign in to comment.