Skip to content

Commit a1776a2

Browse files
MC-17947: Search by email is working incorrect in Sales > Orders grid
1 parent 4488680 commit a1776a2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616
class FulltextFilter implements FilterApplierInterface
1717
{
1818
/**
19-
* Patterns using in preg_replace for emails
19+
* Patterns using in preg_replace
2020
*/
21-
private const EMAIL_REPLACE_PATTERNS = ['/@/', '/\./'];
21+
private $patterns = [
22+
'/[@\.]/' => '\_',
23+
'/([+\-><\(\)~*]+)/' => ' ',
24+
];
2225

2326
/**
2427
* Returns list of columns from fulltext index (doesn't support more then one FTI per table)
@@ -75,8 +78,7 @@ function ($column) use ($alias) {
7578
*/
7679
private function escapeAgainstValue(string $value): string
7780
{
78-
$value = preg_replace('/([+\-><\(\)~*]+)/', ' ', $value);
79-
return preg_replace(self::EMAIL_REPLACE_PATTERNS, '\_', $value);
81+
return preg_replace(array_keys($this->patterns), array_values($this->patterns), $value);
8082
}
8183

8284
/**

0 commit comments

Comments
 (0)