From dfc33c89b8cac25951867a2e6821120c92bb055b Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Mon, 4 Jul 2016 11:43:44 -0400 Subject: Bug 1284277 - allow inbound_proxy to be set to '*' r=dkl --- Bugzilla/Config/Advanced.pm | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Config/Advanced.pm') diff --git a/Bugzilla/Config/Advanced.pm b/Bugzilla/Config/Advanced.pm index 75afe7b22..b3968a254 100644 --- a/Bugzilla/Config/Advanced.pm +++ b/Bugzilla/Config/Advanced.pm @@ -26,7 +26,7 @@ use constant get_param_list => ( name => 'inbound_proxies', type => 't', default => '', - checker => \&check_ip + checker => \&check_inbound_proxies }, { @@ -44,4 +44,15 @@ use constant get_param_list => ( }, ); +sub check_inbound_proxies { + my $inbound_proxies = shift; + + return "" if $inbound_proxies eq "*"; + my @proxies = split(/[\s,]+/, $inbound_proxies); + foreach my $proxy (@proxies) { + validate_ip($proxy) || return "$proxy is not a valid IPv4 or IPv6 address"; + } + return ""; +} + 1; -- cgit v1.2.3-24-g4f1b