From 175f9c1022672ae8d47c93ad0cf31084eb868ecb Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Tue, 27 Oct 2015 22:27:34 -0400 Subject: Bug 1217536 - allow inbound_proxy supports '*' --- 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 4b57df24d..893213b02 100644 --- a/Bugzilla/Config/Advanced.pm +++ b/Bugzilla/Config/Advanced.pm @@ -47,7 +47,7 @@ use constant get_param_list => ( name => 'inbound_proxies', type => 't', default => '', - checker => \&check_ip + checker => \&check_inbound_proxies }, { @@ -108,4 +108,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