Skip to content

Commit ce1263d

Browse files
committed
Fix exception which is thrown on search results page
1 parent fa211bd commit ce1263d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

app/code/Magento/Search/Model/SynonymAnalyzer.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ private function getSearchPattern(array $words): string
137137
$patterns = [];
138138
for ($lastItem = count($words); $lastItem > 0; $lastItem--) {
139139
$phrase = implode("\s+", \array_slice($words, 0, $lastItem));
140+
$phrase = preg_quote($phrase, '/');
140141
$patterns[] = '^' . $phrase . ',';
141142
$patterns[] = ',' . $phrase . ',';
142143
$patterns[] = ',' . $phrase . '$';

0 commit comments

Comments
 (0)