# HG changeset patch # User Kim Alvefur # Date 1507753106 -7200 # Node ID ff57b3cc5a8e88c950d2ad89dcf650ab3a1963fe # Parent 8648cb171213172697e9673ee40c710e79ed833e mod_pubsub: Make sure that a dataform is given to configure diff -r 8648cb171213 -r ff57b3cc5a8e plugins/mod_pubsub/pubsub.lib.lua --- 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;