diff options
author | ivan <ivan> | 2008-10-28 01:23:08 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-10-28 01:23:08 +0000 |
commit | 96f9e3f0b79a98863023a1bdd29b9dc80738c1b1 (patch) | |
tree | 539be09bfa2f20c630c2cde719f4c7f5e3d29e59 /FS | |
parent | 839d3dfa33b7dc88927a8608ffd10d6675655c10 (diff) |
fix svc_phone non-numeric "phone numbers", RT#4204
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/svc_phone.pm | 5 |
1 files changed, 4 insertions, 1 deletions
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') |