Skip to content

Commit 6b800f0

Browse files
ddurieuxtrasher
authored andcommitted
Fix search to restore a feature removed permit to have only '^' and so return only filled field (so exclude empty and null fields)
1 parent 9b7034d commit 6b800f0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

inc/search.class.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7607,6 +7607,11 @@ static function makeTextSearchValue($val) {
76077607
($matches[1] != '^' ? '%' : '') .
76087608
trim($matches[2]) .
76097609
($matches[3] != '$' ? '%' : '');
7610+
} else if (isset($matches[1])
7611+
&& strlen(trim($matches[1])) == 1
7612+
&& (!isset($matches[3]) || empty($matches[3]))) {
7613+
// this case is for search with only ^, so mean the field is not empty / not null
7614+
$search = '%';
76107615
}
76117616
return $search;
76127617
}

tests/functionnal/Search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1241,7 +1241,7 @@ public function testIsInfocomOption($index, $expected) {
12411241
protected function makeTextSearchValueProvider() {
12421242
return [
12431243
['', ''],
1244-
['^', ''],
1244+
['^', '%'],
12451245
['$', ''],
12461246
['^$', ''],
12471247
['looking for', '%looking for%'],

0 commit comments

Comments
 (0)