From: Weblate Date: Tue, 29 Sep 2015 14:54:36 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/master' X-Git-Tag: 1.1~14 X-Git-Url: https://git.p6c8.net/jirafeau_project.git/commitdiff_plain/a55d668186a73f8dcf98b40e3c22f443c4cd104b?hp=a8cb2b83429c0f5b75f95f639cf8987f2a3c3608 Merge remote-tracking branch 'origin/master' --- diff --git a/lib/functions.php b/lib/functions.php index 83fdaf1..aaa0daf 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1121,6 +1121,8 @@ get_ip_list_http_forwarded() 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)); } @@ -1130,7 +1132,10 @@ get_ip_list_http_forwarded() 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)); } }