Skip to content

Commit 0016cc1

Browse files
committed
TASK: Add some method documentation
1 parent 556a020 commit 0016cc1

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Classes/Utility/SearchTerm.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515

1616
class SearchTerm
1717
{
18+
/**
19+
* According to https://lucene.apache.org/core/3_4_0/queryparsersyntax.html#Escaping%20Special%20Characters,
20+
* special characters should be escapable using a „\“ character. Sadly because of some internal json encoding this doesn't work properly.
21+
* Any of these characters break the query and are removed.
22+
*
23+
* @param string $input
24+
* @return string
25+
*/
1826
public static function sanitize(string $input): string
1927
{
2028
return str_replace(['\\', '=', '>', '<', '(', ')', '{', '}', '[', ']', '^', '"', '~', '*', '?', ':', '/'], '', $input);

0 commit comments

Comments
 (0)