Skip to content

Commit d705853

Browse files
committed
Removed second sanitize method as it's too strict.
1 parent 50df885 commit d705853

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/Pecee/BooleanQueryParser/BooleanQueryParser.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ public function parse(string $string): ?string
4545
return null;
4646
}
4747

48-
// Clean the words of anything we dont want
49-
$tokens = $this->secondClean($tokens);
50-
5148
// Any hyphenated words should be merged to they are taken as is (john-paul should be "john-paul" not +john -paul)
5249
$tokens = $this->mergeHyphenatedWords($tokens);
5350

@@ -106,25 +103,6 @@ protected function firstClean(string $string): string
106103
return strtolower(trim($output));
107104
}
108105

109-
/**
110-
* We need to process each element in turn now and clean/sanitise it
111-
*
112-
* @param array $tokens
113-
*
114-
* @return array
115-
*/
116-
protected function secondClean(array $tokens): array
117-
{
118-
$toReturn = [];
119-
120-
foreach ($tokens as $token) {
121-
$token = preg_replace('/[^\p{L}0-9 @\(\)\-\+\*\"\.]/ui', '', $token);
122-
$toReturn[] = $token;
123-
}
124-
125-
return $toReturn;
126-
}
127-
128106
/**
129107
* Because we don't want hyphenated words to be treated differently, lets merge them in quotes
130108
*

0 commit comments

Comments
 (0)