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

@@ -313,7 +313,7 @@ class GroupCollector implements GroupCollectorInterface
$this->query->where(
static function (EloquentBuilder $q) use ($array) {
$q->where(
function (EloquentBuilder $q1) use ($array) {
static function (EloquentBuilder $q1) use ($array) {
foreach ($array as $word) {
$keyword = sprintf('%%%s%%', $word);
$q1->where('transaction_journals.description', 'LIKE', $keyword);

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));
}