Software /
code /
prosody
Diff
util/dataforms.lua @ 4928:5211c11dd865
util.dataforms: Fix parsing of -multi fields
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Tue, 12 Jun 2012 18:29:58 +0200 |
parent | 4887:4dd61fe04db4 |
child | 5551:e1e06f1465be |
line wrap: on
line diff
--- a/util/dataforms.lua Tue Jun 12 14:29:04 2012 +0200 +++ b/util/dataforms.lua Tue Jun 12 18:29:58 2012 +0200 @@ -185,7 +185,7 @@ function (field_tag, required) local result = {}; for value in field_tag:childtags("value") do - result[#result+1] = value; + result[#result+1] = value:get_text(); end return result, (required and #result == 0 and "Required value missing" or nil); end @@ -202,10 +202,10 @@ field_readers["list-single"] = field_readers["text-single"]; - local boolean_values = { - ["1"] = true, ["true"] = true, - ["0"] = false, ["false"] = false, - }; +local boolean_values = { + ["1"] = true, ["true"] = true, + ["0"] = false, ["false"] = false, +}; field_readers["boolean"] = function (field_tag, required)