From: David Lawrence Date: Fri, 12 Aug 2016 20:22:05 +0000 (+0000) Subject: Bug 1294571 - 015remote_ip.t throws a "uninitialized value" warning X-Git-Tag: release-5.1.2~92 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e480f6552f2ecb594d44d88ad5b4e5cb51caf52c;p=thirdparty%2Fbugzilla.git Bug 1294571 - 015remote_ip.t throws a "uninitialized value" warning --- diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index dc41652f7a..1a867c5ee2 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -291,7 +291,7 @@ sub remote_ip { my @x_forwarded_for = split(/[\s,]+/, $ENV{HTTP_X_FORWARDED_FOR} // ''); return $remote_ip unless @x_forwarded_for; - return $x_forwarded_for[0] if $proxies[0] eq '*'; + return $x_forwarded_for[0] if (@proxies && $proxies[0] eq '*'); return $remote_ip if none { $_ eq $remote_ip } @proxies; foreach my $ip (reverse @x_forwarded_for) {