From 4ed7a1d5299bb7bc6bcdf02710980ed10f746afa Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 26 Oct 2020 19:12:20 +0000 Subject: [PATCH] booleanise pools --- ext/pools/main.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/pools/main.php b/ext/pools/main.php index 6ff64e2c..80e71751 100644 --- a/ext/pools/main.php +++ b/ext/pools/main.php @@ -132,7 +132,7 @@ class Pools extends Extension $database->create_table("pools", " id SCORE_AIPK, user_id INTEGER NOT NULL, - public SCORE_BOOL NOT NULL DEFAULT SCORE_BOOL_N, + public BOOLEAN NOT NULL DEFAULT FALSE, title VARCHAR(255) NOT NULL, description TEXT, date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, @@ -168,6 +168,10 @@ class Pools extends Extension $this->set_version("ext_pools_version", 3); // skip 2 } + if ($this->get_version("ext_pools_version") < 4) { + $database->standardise_boolean("pools", "public"); + $this->set_version("ext_pools_version", 4); + } } // Add a block to the Board Config / Setup @@ -236,7 +240,7 @@ class Pools extends Extension $event = new PoolCreationEvent( $title, $user, - $_POST["public"] === "Y", + bool_escape($_POST["public"]), $_POST["description"] );