Merge branch 'MDL-47214-ClientIp-wrong-with-multiple-proxies_27_STABLE' of https://github.com/mhughes2k/moodle into MOODLE_27_STABLE

This commit is contained in:
Sam Hemelryk
2014-09-30 08:48:28 +13:00
+2 -1
View File
@@ -8613,7 +8613,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;
}
}