From fb2fe58b572d5eca1644d2d0e102a57a7b2f52f9 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 26 Dec 2019 16:52:59 +0000 Subject: [PATCH] fixes --- ext/log_db/main.php | 8 ++------ ext/not_a_tag/main.php | 5 ++--- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ext/log_db/main.php b/ext/log_db/main.php index 02c67c26..81cd88c6 100644 --- a/ext/log_db/main.php +++ b/ext/log_db/main.php @@ -47,7 +47,7 @@ class ActorColumn extends Column $driver = $this->table->db->getAttribute(\PDO::ATTR_DRIVER_NAME); switch ($driver) { case "pgsql": - return "((username = :{$this->name}_0) OR (address && inet :{$this->name}_1))"; + return "((username = :{$this->name}_0) OR (address && cast(:{$this->name}_1 as inet)))"; default: return "((username = :{$this->name}_0) OR (address = :{$this->name}_1))"; } @@ -79,11 +79,7 @@ class ActorColumn extends Column $un = null; } if (empty($ip)) { - $driver = $this->table->db->getAttribute(\PDO::ATTR_DRIVER_NAME); - switch ($driver) { - case "pgsql": $ip = "0.0.0.0/0"; break; - default: $ip = null; break; - } + $ip = null; } return [$un, $ip]; } diff --git a/ext/not_a_tag/main.php b/ext/not_a_tag/main.php index f40a8887..52695e4a 100644 --- a/ext/not_a_tag/main.php +++ b/ext/not_a_tag/main.php @@ -116,9 +116,8 @@ class NotATag extends Extension $input = validate_input(["d_tag"=>"string"]); $database->execute( $database->scoreql_to_sql( - "DELETE FROM untags WHERE LOWER(tag) = LOWER(:tag)" - ), - + "DELETE FROM untags WHERE LOWER(tag) = LOWER(:tag)" + ), ["tag"=>$input['d_tag']] ); $page->flash("Image ban removed");