From: ivan Date: Tue, 28 Oct 2008 01:23:08 +0000 (+0000) Subject: fix svc_phone non-numeric "phone numbers", RT#4204 X-Git-Tag: root_of_webpay_support~281 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=96f9e3f0b79a98863023a1bdd29b9dc80738c1b1 fix svc_phone non-numeric "phone numbers", RT#4204 --- diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm index c356344dd..237bbf5c7 100644 --- a/FS/FS/svc_phone.pm +++ b/FS/FS/svc_phone.pm @@ -182,17 +182,20 @@ sub check { my $conf = new FS::Conf; my $phonenum = $self->phonenum; + my $phonenum_check_method; if ( $conf->exists('svc_phone-allow_alpha_phonenum') ) { $phonenum =~ s/\W//g; + $phonenum_check_method = 'ut_alpha'; } else { $phonenum =~ s/\D//g; + $phonenum_check_method = 'ut_number'; } $self->phonenum($phonenum); my $error = $self->ut_numbern('svcnum') || $self->ut_numbern('countrycode') - || $self->ut_number('phonenum') + || $self->$phonenum_check_method('phonenum') || $self->ut_anything('sip_password') || $self->ut_numbern('pin') || $self->ut_textn('phone_name')