Signed-off-by: Jerome Jutteau <mojo@couak.net>
if (!empty ($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$l = explode (',', $_SERVER['HTTP_X_FORWARDED_FOR']);
+ if ($l === FALSE)
+ return array();
foreach ($l as $ip)
array_push ($ip_list, preg_replace ('/\s+/', '', $ip));
}
foreach ($l as $ip)
{
// Separate IP from port
- $ip = explode (':', $ip)[0];
+ $ipa = explode (':', $ip);
+ if ($ipa === FALSE)
+ continue;
+ $ip = $ipa[0];
array_push ($ip_list, preg_replace ('/\s+/', '', $ip));
}
}