aboutsummaryrefslogtreecommitdiffstats
path: root/util/dataforms.lua
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
commitea0a2a6ecb4b696189f04e4b8f3eaf5e0969699f (patch)
treea05d45cdadbcec9f3b8d024916400638f2a2c74a /util/dataforms.lua
parent6033bbbd91b4c925b78cc05c873c4f249177c555 (diff)
downloadprosody-ea0a2a6ecb4b696189f04e4b8f3eaf5e0969699f.tar.gz
prosody-ea0a2a6ecb4b696189f04e4b8f3eaf5e0969699f.zip
util.dataforms: Fix verfication for booleans
Diffstat (limited to 'util/dataforms.lua')
-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