This commit is contained in:
Shish 2020-11-15 13:20:30 +00:00
parent 3a9fd38cb0
commit df797745e6

View File

@ -28,7 +28,8 @@ class AutoComplete extends Extension
$this->theme->build_autocomplete($page); $this->theme->build_autocomplete($page);
} }
private function complete(string $search, int $limit): array { private function complete(string $search, int $limit): array
{
global $cache, $database; global $cache, $database;
if (!$search) { if (!$search) {
@ -58,7 +59,8 @@ class AutoComplete extends Extension
$res = $cache->get($cache_key); $res = $cache->get($cache_key);
if (!$res) { if (!$res) {
$res = $database->get_pairs(" $res = $database->get_pairs(
"
SELECT tag, count SELECT tag, count
FROM tags FROM tags
WHERE LOWER(tag) LIKE LOWER(:search) WHERE LOWER(tag) LIKE LOWER(:search)