aboutsummaryrefslogtreecommitdiffstats
path: root/core/xmlhandlers.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-11-12 13:42:44 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-11-12 13:42:44 +0500
commit316bc45e71aa55d276b11986115d5e40661bd607 (patch)
treeeae786040e13eb74d13aaf41e66d3f3f9b8b8e8f /core/xmlhandlers.lua
parent41079afbb43ebd56b5aa5cc43da2e84120c0b012 (diff)
downloadprosody-316bc45e71aa55d276b11986115d5e40661bd607.tar.gz
prosody-316bc45e71aa55d276b11986115d5e40661bd607.zip
Changed separator between attribute names and prefixes from '|' to '\1' (optimization and cleanup).
Diffstat (limited to 'core/xmlhandlers.lua')
-rw-r--r--core/xmlhandlers.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/xmlhandlers.lua b/core/xmlhandlers.lua
index 9ded74c3..d679af97 100644
--- a/core/xmlhandlers.lua
+++ b/core/xmlhandlers.lua
@@ -29,7 +29,6 @@ local ns_prefixes = {
function init_xmlhandlers(session, stream_callbacks)
local ns_stack = { "" };
- local curr_ns, name = "";
local curr_tag;
local chardata = {};
local xml_handlers = {};
@@ -50,7 +49,7 @@ 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("^([^\1]*)\1?(.*)$");
if not name then
curr_ns, name = "", curr_ns;
end
@@ -63,7 +62,7 @@ function init_xmlhandlers(session, stream_callbacks)
for i=1,#attr do
local k = attr[i];
attr[i] = nil;
- local ns, nm = k:match("^([^|]+)|?([^|]-)$")
+ local ns, nm = k:match("^([^\1]*)\1?(.*)$");
if ns and nm then
ns = ns_prefixes[ns];
if ns then
@@ -105,7 +104,7 @@ function init_xmlhandlers(session, stream_callbacks)
end
end
function xml_handlers:EndElement(tagname)
- curr_ns,name = tagname:match("^(.-)|?([^%|]-)$");
+ local curr_ns,name = tagname:match("^([^\1]*)\1?(.*)$");
if not name then
curr_ns, name = "", curr_ns;
end