Skip to content

Commit 3549798

Browse files
committed
BUGFIX: Remove special characters completely
According to https://lucene.apache.org/core/3_4_0/queryparsersyntax.html#Escaping%20Special%20Characters, special characters should be escapeable using a „\“ character. Sadly because of some internal json encoding this doesn’t work properly. Any of these characters break the query.
1 parent 2bfbb20 commit 3549798

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Classes/Utility/SearchTerm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class SearchTerm
1818

1919
public static function sanitizeSearchInput(string $input): string
2020
{
21-
return str_replace(['=', '>', '<', '(', ')', '{', '}', '[', ']', '^', '"', '~', '*', '?', ':', '\\', '/'], ['', '', '', '(', '\)', '\{', '\}', '\[', '\]', '\^', '\"', '\~', '\*', '\?', '\:', '\\\\', '\/'], $input);
21+
return str_replace(['\\', '=', '>', '<', '(', ')', '{', '}', '[', ']', '^', '"', '~', '*', '?', ':', '/'], '', $input);
2222
}
2323

2424
}

0 commit comments

Comments
 (0)