projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2c04f1d
)
don't allow three character substring searches, RT#75012
author
Ivan Kohler
<ivan@freeside.biz>
Thu, 27 Apr 2017 18:47:04 +0000
(11:47 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Thu, 27 Apr 2017 18:48:05 +0000
(11:48 -0700)
FS/FS/cust_main/Search.pm
patch
|
blob
|
history
diff --git
a/FS/FS/cust_main/Search.pm
b/FS/FS/cust_main/Search.pm
index
ef106b5
..
5c21a8e
100644
(file)
--- 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 = ();
#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%" }, },
@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%" }, },
@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',
push @cust_main, qsearch( {
table => 'cust_main',
@@
-444,7
+444,8
@@
sub smart_search {
'contact.first' => $first }, #
%fuzopts
);
'contact.first' => $first }, #
%fuzopts
);
- }
+ }
+
foreach my $field ( 'first', 'last', 'company', 'ship_company' ) {
push @cust_main, FS::cust_main::Search->fuzzy_search(
{ $field => $value },
foreach my $field ( 'first', 'last', 'company', 'ship_company' ) {
push @cust_main, FS::cust_main::Search->fuzzy_search(
{ $field => $value },