From 9feea5b43626b594ea4858a9ded6dc45e30c9ce6 Mon Sep 17 00:00:00 2001 From: jove Date: Fri, 4 Mar 2016 21:22:17 +0000 Subject: [PATCH 1/2] Board lock workaround Works around the fact that individual board configs are not loaded when posting by making locked boards a global setting that takes an array of boards Obviously the proper fix is to correctly load the board configs but I can't be arsed. --- post.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post.php b/post.php index 729170a7..77066449 100644 --- a/post.php +++ b/post.php @@ -17,7 +17,7 @@ if (get_magic_quotes_gpc()) { $_POST = strip_array($_POST); } -if ((!isset($_POST['mod']) || !$_POST['mod']) && $config['board_locked']) { +if ((!isset($_POST['mod']) || !$_POST['mod']) && is_array($config['board_locked']) && in_array(strtolower($_POST["board"]), $config['board_locked'])) { error("Board is locked"); } From 1bacfecdfe9d6050452327bbdb9fe8894a0192d0 Mon Sep 17 00:00:00 2001 From: jove Date: Sat, 5 Mar 2016 02:44:33 +0000 Subject: [PATCH 2/2] Better board lock work around. Taking into account barrucadu's comments. --- post.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 77066449..99ef4850 100644 --- a/post.php +++ b/post.php @@ -17,7 +17,9 @@ if (get_magic_quotes_gpc()) { $_POST = strip_array($_POST); } -if ((!isset($_POST['mod']) || !$_POST['mod']) && is_array($config['board_locked']) && in_array(strtolower($_POST["board"]), $config['board_locked'])) { +if ((!isset($_POST['mod']) || !$_POST['mod']) + && ($config['board_locked']===true + || (is_array($config['board_locked']) && in_array(strtolower($_POST['board']), $config['board_locked'])))){ error("Board is locked"); }