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
commitcb3160b5f9fd8a04489e60a8d80ad06e6c8c16d9 (patch)
tree55f10bc4fdeb382d72c63f94a434ce8146211172 /plugins/mod_pubsub/pubsub.lib.lua
parent14a3b7858b5c4985407776a1364720e19e333145 (diff)
downloadprosody-cb3160b5f9fd8a04489e60a8d80ad06e6c8c16d9.tar.gz
prosody-cb3160b5f9fd8a04489e60a8d80ad06e6c8c16d9.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;