From 4971fa93372ede7a96a3499076be5ffbced2e5da Mon Sep 17 00:00:00 2001 From: Shish Date: Mon, 19 Oct 2015 07:11:41 +0100 Subject: [PATCH] empty bool = false --- core/util.inc.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/util.inc.php b/core/util.inc.php index 2bb1760e..0dd62e2f 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -286,6 +286,10 @@ function validate_input($inputs) { foreach($inputs as $key => $validations) { $flags = explode(',', $validations); + if(in_array('bool', $flags) && !isset($_POST[$key])) { + $_POST[$key] = 'off'; + } + if(in_array('optional', $flags)) { if(!isset($_POST[$key]) || trim($_POST[$key]) == "") { $outputs[$key] = null;