From d743766939ec1e12e614b6475516dc36ad2641a7 Mon Sep 17 00:00:00 2001 From: Gerhard Jungwirth Date: Tue, 21 Apr 2015 10:09:54 +0200 Subject: [PATCH] MT#12555 allow port in callforward URIs Change-Id: Ic006ff0930b68f4cff20df416c4b8fbce4f8d4f7 --- lib/NGCP/Panel/Field/URI.pm | 2 +- t/unit-formhandler-field-uri.t | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/NGCP/Panel/Field/URI.pm b/lib/NGCP/Panel/Field/URI.pm index b0d9e35721..53a57663fa 100644 --- a/lib/NGCP/Panel/Field/URI.pm +++ b/lib/NGCP/Panel/Field/URI.pm @@ -55,7 +55,7 @@ apply( my $checked; if ($user && $domain) { if ( $user =~ m/^(sip:)?[a-zA-Z0-9\+\-\.]*$/ && - $domain =~ m/^[^;\?:]*$/ ) { + $domain =~ m/^[^;\?:][^;\?]*$/ ) { $checked = $value; } } diff --git a/t/unit-formhandler-field-uri.t b/t/unit-formhandler-field-uri.t index 3226c27662..4765a55056 100644 --- a/t/unit-formhandler-field-uri.t +++ b/t/unit-formhandler-field-uri.t @@ -69,6 +69,24 @@ my $configs = [ }, }, }, + { + works => 1, + config => { + destination => { + destination => 'uri', + uri => { destination => 'alice@10.0.0.1:1234' }, + }, + }, + }, + { + works => 1, + config => { + destination => { + destination => 'uri', + uri => { destination => 'foo@bar.com:1234' }, + }, + }, + }, ]; for my $conf (@{$configs}) {