From b919cb91e0f01b8d6df5544ef939805110bbee25 Mon Sep 17 00:00:00 2001 From: Lars Gebhardt-Kusche Date: Tue, 30 Dec 2025 01:17:31 +0100 Subject: [PATCH] asdasd --- src/App/Search.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/App/Search.php b/src/App/Search.php index 1c750e4..19ae039 100644 --- a/src/App/Search.php +++ b/src/App/Search.php @@ -23,9 +23,21 @@ final class Search $params = []; $i = 0; foreach ($tokens as $tok) { - $ph = ':kw' . $i++; - $conditions[] = "(title LIKE $ph OR teaser_public LIKE $ph OR description LIKE $ph OR city LIKE $ph OR region LIKE $ph OR zip LIKE $ph)"; - $params[$ph] = '%' . $tok . '%'; + $tok = trim($tok); + if ($tok === '') continue; + $ph = [ + ':t' . $i . 'a', + ':t' . $i . 'b', + ':t' . $i . 'c', + ':t' . $i . 'd', + ':t' . $i . 'e', + ':t' . $i . 'f', + ]; + $conditions[] = "(title LIKE {$ph[0]} OR teaser_public LIKE {$ph[1]} OR description LIKE {$ph[2]} OR city LIKE {$ph[3]} OR region LIKE {$ph[4]} OR zip LIKE {$ph[5]})"; + foreach ($ph as $p) { + $params[$p] = '%' . $tok . '%'; + } + $i++; } $where = $conditions ? ('AND ' . implode(' AND ', $conditions)) : '';