diff --git a/src/ORM/Connect/MySQLDatabase.php b/src/ORM/Connect/MySQLDatabase.php index 7469e4292..e5c50d1c4 100644 --- a/src/ORM/Connect/MySQLDatabase.php +++ b/src/ORM/Connect/MySQLDatabase.php @@ -227,8 +227,9 @@ class MySQLDatabase extends Database implements TransactionManager $match[$fileClass] = "MATCH (Name, Title) AGAINST ('$keywords' $boolean) AND ClassName = '$fileClassSQL'"; // We make the relevance search by converting a boolean mode search into a normal one - $relevanceKeywords = str_replace(array('*', '+', '-'), '', $keywords); - $htmlEntityRelevanceKeywords = str_replace(array('*', '+', '-'), '', $htmlEntityKeywords); + $booleanChars = ['*', '+', '@', '-', '(', ')', '<', '>']; + $relevanceKeywords = str_replace($booleanChars, '', $keywords); + $htmlEntityRelevanceKeywords = str_replace($booleanChars, '', $htmlEntityKeywords); $relevance[$pageClass] = "MATCH (Title, MenuTitle, Content, MetaDescription) " . "AGAINST ('$relevanceKeywords') " . "+ MATCH (Title, MenuTitle, Content, MetaDescription) AGAINST ('$htmlEntityRelevanceKeywords')"; diff --git a/tests/php/ORM/Filters/FulltextFilterTest/TestObject.php b/tests/php/ORM/Filters/FulltextFilterTest/TestObject.php index 4ba2cc4f9..68b74e501 100644 --- a/tests/php/ORM/Filters/FulltextFilterTest/TestObject.php +++ b/tests/php/ORM/Filters/FulltextFilterTest/TestObject.php @@ -34,5 +34,4 @@ class TestObject extends DataObject implements TestOnly 'columns' => ['ColumnE'], ], ); - }