aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-02-27 20:01:54 +0100
committerKim Alvefur <zash@zash.se>2020-02-27 20:01:54 +0100
commitd84f765d0427378e9aa83b3a36c1dbb7820adcfa (patch)
treeae8b85157e70de0ea2d05f47b1556b1d483987f0
parent85ce63a7a7d2e83dcf5fdaa9ddf998bb7d21b351 (diff)
downloadprosody-d84f765d0427378e9aa83b3a36c1dbb7820adcfa.tar.gz
prosody-d84f765d0427378e9aa83b3a36c1dbb7820adcfa.zip
mod_pubsub, mod_pep: Ensure correct number of children of <item/> (fixes #1496)
-rw-r--r--plugins/mod_pep.lua2
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index 12be41a2..f8047a92 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -51,7 +51,7 @@ function module.restore(data)
end
function is_item_stanza(item)
- return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item";
+ return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item" and #item.tags == 1;
end
function check_node_config(node, actor, new_config) -- luacheck: ignore 212/node 212/actor
diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua
index 855c5fd2..4276bc5e 100644
--- a/plugins/mod_pubsub/mod_pubsub.lua
+++ b/plugins/mod_pubsub/mod_pubsub.lua
@@ -112,7 +112,7 @@ function check_node_config(node, actor, new_config) -- luacheck: ignore 212/acto
end
function is_item_stanza(item)
- return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item";
+ return st.is_stanza(item) and item.attr.xmlns == xmlns_pubsub and item.name == "item" and #item.tags == 1;
end
module:hook("pubsub-summary/http://www.w3.org/2005/Atom", function (event)