X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fsearch%2Fcdr.html;h=778799b1fc21a293d8ed2345b46589a738624e95;hb=470878235c5f61ca7acc6ef618943071ca9736b5;hp=10b386383f6c4f104dd5d597c09c856e8b5c8ac0;hpb=6912944a9959e4046b095fbd378f5545c2caca9e;p=freeside.git diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html index 10b386383..778799b1f 100644 --- a/httemplate/search/cdr.html +++ b/httemplate/search/cdr.html @@ -264,11 +264,9 @@ if ( $cgi->param('acctid') =~ /\d/ ) { if ( $cgi->param('accountcode') =~ /\S/ ) { my $accountcode = $cgi->param('accountcode'); my @accountcode = map { - ( my $v = $_ ) =~ s/^\s+|\s+$//g; - if ( $v =~ /'/ ) { $v =~ s/'/\\'/g; $v = "E'$v'" } - elsif ( length $v ) { $v = "'$v'" } - length $v ? $v : () - } grep /\S/, split /\R/, $accountcode; + ( my $v = $_ ) =~ s/^\s+|\s+$//g; # trim margin whitespace + length $v ? dbh->quote($v) : () + } grep /\S/, split /\R/, $accountcode; # collect non-trivial lines if (@accountcode) { my $search = 'accountcode IN ( ' . join( ',', @accountcode ) . ' )'; push @qsearch, $search;