MDL-47214 core: IPs should be cleaned

This commit is contained in:
Andrew Nicols
2014-10-01 15:29:30 +08:00
parent c90137561b
commit 9c8f956e9d
+1 -1
View File
@@ -8615,7 +8615,7 @@ function getremoteaddr($default='0.0.0.0') {
if (!($variablestoskip & GETREMOTEADDR_SKIP_HTTP_X_FORWARDED_FOR)) {
if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$hdr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']);
$address = $hdr[0];
$address = cleanremoteaddr($hdr[0]);
return $address ? $address : $default;
}
}