From 634124e17fd036575273eb93f6917ae35e24fcf8 Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 26 Oct 2020 22:43:47 +0000 Subject: [PATCH] different hack for old sqlite --- core/dbengine.php | 1 + ext/private_image/main.php | 14 +++++++------- ext/trash/main.php | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/core/dbengine.php b/core/dbengine.php index 638da437..cd3f4bb4 100644 --- a/core/dbengine.php +++ b/core/dbengine.php @@ -217,6 +217,7 @@ 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("DEFAULT FALSE", "DEFAULT 0", $data); return $data; } diff --git a/ext/private_image/main.php b/ext/private_image/main.php index 316d079e..a22b9420 100644 --- a/ext/private_image/main.php +++ b/ext/private_image/main.php @@ -133,13 +133,13 @@ class PrivateImage extends Extension if ($show_private) { $event->add_querylet( new Querylet( - "private != :true OR owner_id = :private_owner_id", - ["private_owner_id"=>$user->id, "true"=>true] + "private = :false OR owner_id = :private_owner_id", + ["private_owner_id"=>$user->id, "false"=>false] ) ); } else { $event->add_querylet( - new Querylet("private != :true", ["true"=>true]) + new Querylet("private = :false", ["false"=>false]) ); } } @@ -153,8 +153,8 @@ class PrivateImage extends Extension $query = ""; switch ($matches[1]) { case "no": - $query .= "private != :true"; - $params["true"] = true; + $query .= "private = :false"; + $params["false"] = false; break; case "yes": $query .= "private = :true"; @@ -168,8 +168,8 @@ class PrivateImage extends Extension } break; case "any": - $query .= "private != :true OR owner_id = :private_owner_id"; - $params["true"] = true; + $query .= "private = :false OR owner_id = :private_owner_id"; + $params["false"] = false; $params["private_owner_id"] = $user->id; break; } diff --git a/ext/trash/main.php b/ext/trash/main.php index 91dcf985..c80eb7da 100644 --- a/ext/trash/main.php +++ b/ext/trash/main.php @@ -97,7 +97,7 @@ class Trash extends Extension $matches = []; if (is_null($event->term) && $this->no_trash_query($event->context)) { - $event->add_querylet(new Querylet("trash != :true", ["true"=>true])); + $event->add_querylet(new Querylet("trash = :false", ["false"=>false])); } if (is_null($event->term)) {