aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/pubsub.lib.lua
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
commit9daf5dbd6db390257237816a1489179552bfcc1b (patch)
tree55f10bc4fdeb382d72c63f94a434ce8146211172 /plugins/mod_pubsub/pubsub.lib.lua
parent1b147b03d42fe9dec4e17a3238cf037f470d13b4 (diff)
downloadprosody-9daf5dbd6db390257237816a1489179552bfcc1b.tar.gz
prosody-9daf5dbd6db390257237816a1489179552bfcc1b.zip
mod_pubsub: Make sure that a dataform is given to configure
Diffstat (limited to 'plugins/mod_pubsub/pubsub.lib.lua')
-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;