Revert "different hack for old sqlite"

This reverts commit 634124e17f.
This commit is contained in:
Shish 2020-10-26 22:49:39 +00:00
parent 634124e17f
commit 56f1fac4c5
3 changed files with 8 additions and 9 deletions

View file

@ -217,7 +217,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("DEFAULT FALSE", "DEFAULT 0", $data);
return $data;
}

View file

@ -133,13 +133,13 @@ class PrivateImage extends Extension
if ($show_private) {
$event->add_querylet(
new Querylet(
"private = :false OR owner_id = :private_owner_id",
["private_owner_id"=>$user->id, "false"=>false]
"private != :true OR owner_id = :private_owner_id",
["private_owner_id"=>$user->id, "true"=>true]
)
);
} else {
$event->add_querylet(
new Querylet("private = :false", ["false"=>false])
new Querylet("private != :true", ["true"=>true])
);
}
}
@ -153,8 +153,8 @@ class PrivateImage extends Extension
$query = "";
switch ($matches[1]) {
case "no":
$query .= "private = :false";
$params["false"] = false;
$query .= "private != :true";
$params["true"] = true;
break;
case "yes":
$query .= "private = :true";
@ -168,8 +168,8 @@ class PrivateImage extends Extension
}
break;
case "any":
$query .= "private = :false OR owner_id = :private_owner_id";
$params["false"] = false;
$query .= "private != :true OR owner_id = :private_owner_id";
$params["true"] = true;
$params["private_owner_id"] = $user->id;
break;
}

View file

@ -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 = :false", ["false"=>false]));
$event->add_querylet(new Querylet("trash != :true", ["true"=>true]));
}
if (is_null($event->term)) {