Software /
code /
prosody
Diff
plugins/mod_pubsub/pubsub.lib.lua @ 8317:ff57b3cc5a8e
mod_pubsub: Make sure that a dataform is given to configure
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 11 Oct 2017 22:18:26 +0200 |
parent | 8308:ab189d3f55d1 |
child | 8318:d0a7fc7614de |
line wrap: on
line diff
--- a/plugins/mod_pubsub/pubsub.lib.lua Tue Oct 10 01:41:47 2017 +0200 +++ b/plugins/mod_pubsub/pubsub.lib.lua Wed Oct 11 22:18:26 2017 +0200 @@ -294,7 +294,12 @@ origin.send(pubsub_error_reply(stanza, "forbidden")); return true; end - local new_config, err = node_config_form:data(config.tags[1]); + local config_form = config:get_child("x", "jabber:x:data"); + if not config_form then + origin.send(st.error_reply(stanza, "modify", "bad-request", "Missing dataform")); + return true; + end + local new_config, err = node_config_form:data(config_form); if not new_config then origin.send(st.error_reply(stanza, "modify", "bad-request", err)); return true;