From ea0a2a6ecb4b696189f04e4b8f3eaf5e0969699f Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Sat, 3 Dec 2011 17:10:48 +0100 Subject: util.dataforms: Fix verfication for booleans --- util/dataforms.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/dataforms.lua b/util/dataforms.lua index b69df819..d4a1865c 100644 --- a/util/dataforms.lua +++ b/util/dataforms.lua @@ -252,7 +252,7 @@ field_readers["boolean"] = field_verifiers["boolean"] = function (data, field_tag, required) data = field_readers["text-single"](field_tag); - if #data == 0 and required then + if ((not data) or (#data == 0)) and required then return "Required value missing"; end if data ~= "1" and data ~= "true" and data ~= "0" and data ~= "false" then -- cgit v1.2.3