From b5d56214cdb5863a493e545629e46e9c0d0576d0 Mon Sep 17 00:00:00 2001 From: Daku Date: Sat, 18 Jun 2016 14:45:21 +0100 Subject: [PATCH] fix case-insensitive autocomplete on postgres --- ext/autocomplete/main.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ext/autocomplete/main.php b/ext/autocomplete/main.php index d6656bcd..918796a4 100644 --- a/ext/autocomplete/main.php +++ b/ext/autocomplete/main.php @@ -22,16 +22,15 @@ class AutoComplete extends Extension { $cache_key .= "-" . $_GET["limit"]; } - $res = null; $res = $database->cache->get($cache_key); if(!$res) { - $res = $database->get_pairs(" + $res = $database->get_pairs($database->scoreql_to_sql(" SELECT tag, count FROM tags - WHERE tag LIKE :search + WHERE SCORE_STRNORM(tag) LIKE SCORE_STRNORM(:search) AND count > 0 ORDER BY count DESC - $limitSQL", $SQLarr + $limitSQL"), $SQLarr ); $database->cache->set($cache_key, $res, 600); }