mirror of
https://github.com/bjc/prosody.git
synced 2025-04-05 06:07:37 +03:00
util.dataforms: Fix parsing of -multi fields
This commit is contained in:
parent
f76c2aa90b
commit
49d3586dc1
1 changed files with 5 additions and 5 deletions
|
@ -185,7 +185,7 @@ field_readers["list-multi"] =
|
||||||
function (field_tag, required)
|
function (field_tag, required)
|
||||||
local result = {};
|
local result = {};
|
||||||
for value in field_tag:childtags("value") do
|
for value in field_tag:childtags("value") do
|
||||||
result[#result+1] = value;
|
result[#result+1] = value:get_text();
|
||||||
end
|
end
|
||||||
return result, (required and #result == 0 and "Required value missing" or nil);
|
return result, (required and #result == 0 and "Required value missing" or nil);
|
||||||
end
|
end
|
||||||
|
@ -202,10 +202,10 @@ field_readers["text-multi"] =
|
||||||
field_readers["list-single"] =
|
field_readers["list-single"] =
|
||||||
field_readers["text-single"];
|
field_readers["text-single"];
|
||||||
|
|
||||||
local boolean_values = {
|
local boolean_values = {
|
||||||
["1"] = true, ["true"] = true,
|
["1"] = true, ["true"] = true,
|
||||||
["0"] = false, ["false"] = false,
|
["0"] = false, ["false"] = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
field_readers["boolean"] =
|
field_readers["boolean"] =
|
||||||
function (field_tag, required)
|
function (field_tag, required)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue