Skip to content

Commit c9a74f9

Browse files
ENGCOM-1486: [Forwardport] FIX for issue#14855 - Adding an * to do a customer search #15077
- Merge Pull Request #15077 from adrian-martinez-interactiv4/magento2:2.3-develop-PR-port-14905 - Merged commits: 1. 01b546f
2 parents a53347e + 01b546f commit c9a74f9

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)