# HG changeset patch # User Florian Zeitz # Date 1322928648 -3600 # Node ID b672fe29184b113dff5f38afc8a833580d7640f7 # Parent e68bc6f35106c6b97c2f95c496c7c410078ee886 util.dataforms: Fix verfication for booleans diff -r e68bc6f35106 -r b672fe29184b util/dataforms.lua --- a/util/dataforms.lua Fri Dec 02 19:24:54 2011 +0100 +++ b/util/dataforms.lua Sat Dec 03 17:10:48 2011 +0100 @@ -252,7 +252,7 @@ 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