diff --git a/core/dbengine.php b/core/dbengine.php index d2b96be8..95ded663 100644 --- a/core/dbengine.php +++ b/core/dbengine.php @@ -6,7 +6,6 @@ abstract class SCORE const BOOL_Y = "SCORE_BOOL_Y"; const BOOL_N = "SCORE_BOOL_N"; const BOOL = "SCORE_BOOL"; - const ILIKE = "SCORE_ILIKE"; } abstract class DBEngine @@ -54,7 +53,6 @@ class MySQL extends DBEngine $data = str_replace(SCORE::BOOL_Y, "'$this->BOOL_Y'", $data); $data = str_replace(SCORE::BOOL_N, "'$this->BOOL_N'", $data); $data = str_replace(SCORE::BOOL, "ENUM('Y', 'N')", $data); - $data = str_replace(SCORE::ILIKE, "LIKE", $data); return $data; } @@ -99,7 +97,6 @@ class PostgreSQL extends DBEngine $data = str_replace(SCORE::BOOL_Y, $this->BOOL_Y, $data); $data = str_replace(SCORE::BOOL_N, $this->BOOL_N, $data); $data = str_replace(SCORE::BOOL, "BOOL", $data); - $data = str_replace(SCORE::ILIKE, "ILIKE", $data); return $data; } @@ -193,7 +190,6 @@ class SQLite extends DBEngine $data = str_replace(SCORE::BOOL_Y, "'$this->BOOL_Y'", $data); $data = str_replace(SCORE::BOOL_N, "'$this->BOOL_N'", $data); $data = str_replace(SCORE::BOOL, "CHAR(1)", $data); - $data = str_replace(SCORE::ILIKE, "LIKE", $data); return $data; } diff --git a/ext/not_a_tag/main.php b/ext/not_a_tag/main.php index b9c18e93..43975956 100644 --- a/ext/not_a_tag/main.php +++ b/ext/not_a_tag/main.php @@ -139,11 +139,11 @@ class NotATag extends Extension $where = ["(1=1)"]; $args = ["limit"=>$size, "offset"=>($page-1)*$size]; if (!empty($_GET['tag'])) { - $where[] = 'tag SCORE_ILIKE :tag'; + $where[] = 'LOWER(tag) LIKE LOWER(:tag)'; $args["tag"] = "%".$_GET['tag']."%"; } if (!empty($_GET['redirect'])) { - $where[] = 'redirect SCORE_ILIKE :redirect'; + $where[] = 'LOWER(redirect) LIKE LOWER(:redirect)'; $args["redirect"] = "%".$_GET['redirect']."%"; } $where = implode(" AND ", $where); diff --git a/ext/tag_list/main.php b/ext/tag_list/main.php index 5b93d9b4..1c309437 100644 --- a/ext/tag_list/main.php +++ b/ext/tag_list/main.php @@ -283,7 +283,7 @@ class TagList extends Extension FLOOR(LOG(2.7, LOG(2.7, count - :tags_min2 + 1)+1)*1.5*100)/100 AS scaled FROM tags WHERE count >= :tags_min - AND tag SCORE_ILIKE :starts_with + AND LOWER(tag) LIKE LOWER(:starts_with) ORDER BY LOWER(tag) "), ["tags_min"=>$tags_min, "tags_min2"=>$tags_min, "starts_with"=>$starts_with]); @@ -326,7 +326,7 @@ class TagList extends Extension SELECT tag, count FROM tags WHERE count >= :tags_min - AND tag SCORE_ILIKE :starts_with + AND LOWER(tag) LIKE LOWER(:starts_with) ORDER BY LOWER(tag) "), ["tags_min"=>$tags_min, "starts_with"=>$starts_with]);