Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 8f7d2f4

Browse files
author
Stanislav Idolov
authored
ENGCOM-1486: [Forwardport] FIX for issue#14855 - Adding an * to do a customer search #15077
2 parents 1c627a8 + c9a74f9 commit 8f7d2f4

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)