X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FRecord.pm;h=3b1967e429adf8e7562e4e3ebb1adf6b0512bac3;hb=c8caa293a6b25b86b05b78faadd08da16f3f9614;hp=201e7b23cdf3e8378fe6089a57a8b5789ebdd8bf;hpb=7e0aae7956b9f07d88295a350e560978032847fd;p=freeside.git diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 201e7b23c..3b1967e42 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -2140,7 +2140,7 @@ sub ut_alpha { ''; } -=item ut_alpha COLUMN +=item ut_alphan COLUMN Check/untaint alphanumeric strings (no spaces). May be null. If there is an error, returns the error, otherwise returns false. @@ -2155,6 +2155,22 @@ sub ut_alphan { ''; } +=item ut_alphasn COLUMN + +Check/untaint alphanumeric strings, spaces allowed. May be null. If there is +an error, returns the error, otherwise returns false. + +=cut + +sub ut_alphasn { + my($self,$field)=@_; + $self->getfield($field) =~ /^([\w ]*)$/ + or return "Illegal (alphanumeric) $field: ". $self->getfield($field); + $self->setfield($field,$1); + ''; +} + + =item ut_alpha_lower COLUMN Check/untaint lowercase alphanumeric strings (no spaces). May not be null. If