comparison mod_rest/jsonmap.lib.lua @ 3851:8dbca6a93988

mod_rest: Only pass trough valid disco#item item attributes
author Kim Alvefur <zash@zash.se>
date Sat, 25 Jan 2020 00:29:34 +0100
parents 8d13b9c9ba75
children 66f96b98d219
comparison
equal deleted inserted replaced
3850:8d13b9c9ba75 3851:8dbca6a93988
85 end; 85 end;
86 function (s) 86 function (s)
87 local disco = st.stanza("query", { xmlns = "http://jabber.org/protocol/disco#items" }); 87 local disco = st.stanza("query", { xmlns = "http://jabber.org/protocol/disco#items" });
88 if type(s) == "table" then 88 if type(s) == "table" then
89 for _, item in ipairs(s) do 89 for _, item in ipairs(s) do
90 disco:tag("item", item); 90 disco:tag("item", { jid = item.jid, node = item.node, name = item.name });
91 end 91 end
92 end 92 end
93 return disco; 93 return disco;
94 end; 94 end;
95 }; 95 };