MDL-47214 General: Multiple IP addresses in X-Forwarded-For Fixed
Fixed getremoteaddr() function handle multiple IP addresses
This commit is contained in:
+2
-1
@@ -8598,7 +8598,8 @@ function getremoteaddr($default='0.0.0.0') {
|
||||
}
|
||||
if (!($variablestoskip & GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR)) {
|
||||
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$address = cleanremoteaddr($_SERVER['HTTP_X_FORWARDED_FOR']);
|
||||
$hdr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']);
|
||||
$address = $hdr[0];
|
||||
return $address ? $address : $default;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user