summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2017-04-27 11:47:04 -0700
committerIvan Kohler <ivan@freeside.biz>2017-04-27 11:47:37 -0700
commit497b5e7d5bae906216c96d3d59a835779f3ff353 (patch)
tree2499a9c28684a8908139f8ff1e5e3c60bef7fe54
parent01c18fe8ef22a4f364d1d0f109e9a336d10968b9 (diff)
don't allow three character substring searches, RT#75012
-rw-r--r--FS/FS/cust_main/Search.pm9
1 files changed, 5 insertions, 4 deletions
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index c5a87eb04..4473aeda2 100644
--- a/FS/FS/cust_main/Search.pm
+++ b/FS/FS/cust_main/Search.pm
@@ -359,7 +359,7 @@ sub smart_search {
#substring
my @company_hashrefs = ();
- if ( length($value) >= 3 ) {
+ if ( length($value) >= 4 ) {
@company_hashrefs = (
{ 'company' => { op=>'ILIKE', value=>"%$value%" }, },
{ 'ship_company' => { op=>'ILIKE', value=>"%$value%" }, },
@@ -375,7 +375,7 @@ sub smart_search {
},
);
- } elsif ( length($value) >= 3 ) {
+ } elsif ( length($value) >= 4 ) {
@hashrefs = (
{ 'first' => { op=>'ILIKE', value=>"%$value%" }, },
@@ -396,7 +396,7 @@ sub smart_search {
}
- if ( $conf->exists('address1-search') && length($value) >= 3 ) {
+ if ( $conf->exists('address1-search') && length($value) >= 4 ) {
push @cust_main, qsearch( {
table => 'cust_main',
@@ -444,7 +444,8 @@ sub smart_search {
'contact.first' => $first }, #
%fuzopts
);
- }
+ }
+
foreach my $field ( 'first', 'last', 'company', 'ship_company' ) {
push @cust_main, FS::cust_main::Search->fuzzy_search(
{ $field => $value },