aboutsummaryrefslogtreecommitdiffstats
path: root/core/xmlhandlers.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2009-04-23 21:06:08 +0100
committerMatthew Wild <mwild1@gmail.com>2009-04-23 21:06:08 +0100
commitc2e552a434eda3c9616d51f055bb459bbf561816 (patch)
treee496fbacf117db46faaf70ffeba3091ce1431c8b /core/xmlhandlers.lua
parenta7d5181dfbb5f6b2979645ac802cd1a098282d31 (diff)
parentd6b19a1b1b9b46e7c8fe7abe6c1aa234f3fd8096 (diff)
downloadprosody-c2e552a434eda3c9616d51f055bb459bbf561816.tar.gz
prosody-c2e552a434eda3c9616d51f055bb459bbf561816.zip
Merge with 0.4 branch
Diffstat (limited to 'core/xmlhandlers.lua')
-rw-r--r--core/xmlhandlers.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua
index 67a0829d..7e09921c 100644
--- a/core/xmlhandlers.lua
+++ b/core/xmlhandlers.lua
@@ -57,7 +57,11 @@ function init_xmlhandlers(session, stream_callbacks)
stanza:text(t_concat(chardata));
chardata = {};
end
- local curr_ns,name = tagname:match("^(.+)|([^%|]+)$");
+ local curr_ns,name = tagname:match("^(.-)|?([^%|]-)$");
+ if not name then
+ curr_ns, name = "", curr_ns;
+ end
+
if curr_ns ~= stream_default_ns then
attr.xmlns = curr_ns;
end
@@ -109,7 +113,10 @@ function init_xmlhandlers(session, stream_callbacks)
end
end
function xml_handlers:EndElement(tagname)
- curr_ns,name = tagname:match("^(.+)|([^%|]+)$");
+ curr_ns,name = tagname:match("^(.-)|?([^%|]-)$");
+ if not name then
+ curr_ns, name = "", curr_ns;
+ end
if (not stanza) or (#stanza.last_add > 0 and name ~= stanza.last_add[#stanza.last_add].name) then
if tagname == stream_tag then
if cb_streamclosed then