[freeside-commits] branch master updated. f51bc7d5f0f955dde27ab864abad99c56d0a0943
Ivan
ivan at 420.am
Thu Apr 27 11:47:07 PDT 2017
The branch, master has been updated
via f51bc7d5f0f955dde27ab864abad99c56d0a0943 (commit)
from b5d9087e43d24bfa76ca1d87480cc7d95e85c285 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit f51bc7d5f0f955dde27ab864abad99c56d0a0943
Author: Ivan Kohler <ivan at freeside.biz>
Date: Thu Apr 27 11:47:04 2017 -0700
don't allow three character substring searches, RT#75012
diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm
index c5a87eb..4473aed 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 },
-----------------------------------------------------------------------
Summary of changes:
FS/FS/cust_main/Search.pm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
More information about the freeside-commits
mailing list