diff --git a/src/Storage/Repository.php b/src/Storage/Repository.php index b1614b1..4689926 100644 --- a/src/Storage/Repository.php +++ b/src/Storage/Repository.php @@ -171,6 +171,11 @@ class Repository public function searchLogEntries(string $query, int $limit = 200, int $offset = 0): array { + $query = trim($query); + if ($query === '') { + return []; + } + try { $stmt = $this->db->pdo()->prepare( "SELECT e.* FROM log_entries e @@ -182,10 +187,7 @@ class Repository $stmt->execute([$query, $limit, $offset]); return $stmt->fetchAll(); } catch (\PDOException $e) { - if (str_contains($e->getMessage(), 'fts5: syntax error')) { - return $this->searchLogEntriesLike($query, $limit, $offset); - } - throw $e; + return $this->searchLogEntriesLike($query, $limit, $offset); } }