aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-08 17:06:21 +0200
committerKim Alvefur <zash@zash.se>2018-06-08 17:06:21 +0200
commit22e7fd2be13bfc286f6f4656fdbd368ba116bcda (patch)
tree4e3703cef9352587d8d681533d226d4b60d349ce /util
parent1836db91623887b736250cc0a8840fba44368bd8 (diff)
downloadprosody-22e7fd2be13bfc286f6f4656fdbd368ba116bcda.tar.gz
prosody-22e7fd2be13bfc286f6f4656fdbd368ba116bcda.zip
util.stanza: Verify that other objects added as children are valid strings
Diffstat (limited to 'util')
-rw-r--r--util/stanza.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/util/stanza.lua b/util/stanza.lua
index 6453be48..2691cb0b 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -137,8 +137,11 @@ end
function stanza_mt:add_direct_child(child)
if is_stanza(child) then
t_insert(self.tags, child);
+ t_insert(self, child);
+ else
+ check_text(child, "text");
+ t_insert(self, child);
end
- t_insert(self, child);
end
function stanza_mt:add_child(child)