aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-10-11 22:18:26 +0200
committerKim Alvefur <zash@zash.se>2017-10-11 22:18:26 +0200
commitac09d94fc07790d74593526e91d8fd30f1e52e61 (patch)
tree012254b2952ef94be2f9f6c26cfeb4952d0d0694
parentf6243816117a2c991b17ee55b0e219c50d453e5c (diff)
downloadprosody-im-server-ac09d94fc07790d74593526e91d8fd30f1e52e61.tar
prosody-im-server-ac09d94fc07790d74593526e91d8fd30f1e52e61.zip
mod_pubsub: Make sure that a dataform is given to configure
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua7
1 files changed, 6 insertions, 1 deletions
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;