From 9daf5dbd6db390257237816a1489179552bfcc1b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 11 Oct 2017 22:18:26 +0200 Subject: mod_pubsub: Make sure that a dataform is given to configure --- plugins/mod_pubsub/pubsub.lib.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins/mod_pubsub/pubsub.lib.lua') diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua index d4a9eb13..b1f0ce02 100644 --- a/plugins/mod_pubsub/pubsub.lib.lua +++ b/plugins/mod_pubsub/pubsub.lib.lua @@ -294,7 +294,12 @@ function handlers.set_configure(origin, stanza, config, service) 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; -- cgit v1.2.3