Skip to content

Commit d1800b1

Browse files
ENGCOM-1415: FIX for issue#14855 - Adding an * to do a customer search #14905
- Merge Pull Request #14905 from phoenix128/magento2:issue-14855-asterisk-on-grid-search - Merged commits: 1. 187ab1f
2 parents ee0a2d0 + 187ab1f commit d1800b1

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

lib/internal/Magento/Framework/View/Element/UiComponent/DataProvider/FulltextFilter.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ function ($column) use ($alias) {
6262
return $columns;
6363
}
6464

65+
/**
66+
* Escape against value
67+
* @param string $value
68+
* @return string
69+
*/
70+
private function escapeAgainstValue(string $value): string
71+
{
72+
return preg_replace('/([+\-><\(\)~*\"@]+)/', ' ', $value);
73+
}
74+
6575
/**
6676
* Apply fulltext filters
6777
*
@@ -86,7 +96,7 @@ public function apply(Collection $collection, Filter $filter)
8696
$collection->getSelect()
8797
->where(
8898
'MATCH(' . implode(',', $columns) . ') AGAINST(?)',
89-
$filter->getValue()
99+
$this->escapeAgainstValue($filter->getValue())
90100
);
91101
}
92102
}

0 commit comments

Comments
 (0)