aboutsummaryrefslogtreecommitdiffstats
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
commit37344a42d84600131eda7709965c29c57787ab81 (patch)
tree4e3703cef9352587d8d681533d226d4b60d349ce
parentbeac6ef1ea1d9fa358fdc60527952cec1a8f26c7 (diff)
downloadprosody-37344a42d84600131eda7709965c29c57787ab81.tar.gz
prosody-37344a42d84600131eda7709965c29c57787ab81.zip
util.stanza: Verify that other objects added as children are valid strings
-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)