diff options
author | Matthew Wild <mwild1@gmail.com> | 2009-04-23 21:03:24 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2009-04-23 21:03:24 +0100 |
commit | 82a3b3c3eb6213890f9b2b97b32378655f022ff9 (patch) | |
tree | c673e3ce3d0780f8093b4e367a128958b97a3205 | |
parent | 28ae0dd2a96bd440bc3b5d2a1b93cb908d3fea89 (diff) | |
download | prosody-82a3b3c3eb6213890f9b2b97b32378655f022ff9.tar.gz prosody-82a3b3c3eb6213890f9b2b97b32378655f022ff9.zip |
xmlhandlers: Fix tag pattern again for the default namespace
-rw-r--r-- | core/xmlhandlers.lua | 11 |
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 |