Pretty basic fix #3490

This commit is contained in:
James Cole
2020-06-25 15:49:28 +02:00
parent d3bd1f4124
commit 654e0fc74f
2 changed files with 7 additions and 2 deletions

View File

@@ -102,7 +102,7 @@ class Search implements SearchInterface
{
$string = implode(' ', $this->words);
if ('' === $string) {
return \is_string($this->originalQuery) ? $this->originalQuery : '';
return is_string($this->originalQuery) ? $this->originalQuery : '';
}
return $string;
@@ -132,6 +132,11 @@ class Search implements SearchInterface
$filteredQuery = str_replace($match, '', $filteredQuery);
}
$filteredQuery = trim(str_replace(['"', "'"], '', $filteredQuery));
// str replace some stuff:
$search = ['%', '=', '/', '<', '>', '(', ')', ';'];
$filteredQuery = str_replace($search, ' ', $filteredQuery);
if ('' !== $filteredQuery) {
$this->words = array_map('trim', explode(' ', $filteredQuery));
}