aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorFlorian Zeitz <florob@babelmonkeys.de>2011-12-03 17:10:48 +0100
committerFlorian Zeitz <florob@babelmonkeys.de>2011-12-03 17:10:48 +0100
commitdf36a9727516426670630b618f3c3320fd0336a7 (patch)
tree1dc3c35115c68fe74e64c2a13af79ebd1c823d3f /util
parent2dae99da75a98d6f6dccd6983ec5f79dd52ae9d4 (diff)
downloadprosody-df36a9727516426670630b618f3c3320fd0336a7.tar.gz
prosody-df36a9727516426670630b618f3c3320fd0336a7.zip
util.dataforms: Fix verfication for booleans
Diffstat (limited to 'util')
-rw-r--r--util/dataforms.lua2
1 files changed, 1 insertions, 1 deletions
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