Skip to content

Commit 9c1cb77

Browse files
committed
MAGETWO-99669: [Magento Cloud] Error on searching for < symbol
1 parent 8e16abc commit 9c1cb77

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

app/code/Magento/Search/Model/ResourceModel/SynonymReader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private function queryByPhrase($phrase)
106106
*/
107107
private function escapePhrase(string $phrase): string
108108
{
109-
return preg_replace('/@+|[@+-]+$/', '', $phrase);
109+
return preg_replace('/@+|[@+-]+$|[<>]/', '', $phrase);
110110
}
111111

112112
/**

dev/tests/integration/testsuite/Magento/Search/Model/SynonymReaderTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ public static function loadByPhraseDataProvider()
6464
[
6565
'query_value+@', []
6666
],
67+
[
68+
'<', []
69+
],
70+
[
71+
'>', []
72+
],
73+
[
74+
'<english>', [['synonyms' => 'british,english', 'store_id' => 1, 'website_id' => 0]]
75+
],
6776
];
6877
}
6978

0 commit comments

Comments
 (0)