Changeset

4490:b672fe29184b

util.dataforms: Fix verfication for booleans
author Florian Zeitz <florob@babelmonkeys.de>
date Sat, 03 Dec 2011 17:10:48 +0100
parents 4489:e68bc6f35106
children 4491:381e0b874e6d
files util/dataforms.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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