X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.cgi;h=4a3782194e63f522dc135d31868b07a18f0ab208;hb=fba31d6a0954ccfbb1d491ec018f0513d2a4ee2a;hp=0794ad0cbb0f15c9c4b8584fa8f0017614ab3ae9;hpb=5e3669b83521736b7add66986f36f9c3096d187f;p=freeside.git diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 0794ad0cb..4a3782194 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -1,5 +1,5 @@ <% -# +# use strict; #use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby ); @@ -250,11 +250,9 @@ sub lastsearch { $last_type{$_}++; } - my $cust_obj = new FS::cust_main; - $cust_obj->setfield('last', $cgi->param('last_text')); - my $error = $cust_obj->ut_name('last'); - eidiot "Illegal last name" if $error; - my($last) = $cust_obj->getfield('last'); + $cgi->param('last_text') =~ /^([\w \,\.\-\']*)$/ + or eidiot "Illegal last name"; + my($last)=$1; if ( $last_type{'Exact'} && ! $last_type{'Fuzzy'}