Changeset

2261:13d55c66bf81

core.xmlhandlers: Fixed processing of empty namespaces (which caused an issue with jwchat).
author Waqas Hussain <waqas20@gmail.com>
date Sat, 28 Nov 2009 12:00:31 +0500
parents 2260:67b64995ae1e
children 2262:83823ba8de40 2298:508d9dc70bb4
files core/xmlhandlers.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/core/xmlhandlers.lua	Sat Nov 28 11:59:06 2009 +0500
+++ b/core/xmlhandlers.lua	Sat Nov 28 12:00:31 2009 +0500
@@ -50,7 +50,7 @@
 				chardata = {};
 			end
 			local curr_ns,name = tagname:match("^([^\1]*)\1?(.*)$");
-			if not name then
+			if name == "" then
 				curr_ns, name = "", curr_ns;
 			end
 
@@ -63,7 +63,7 @@
 				local k = attr[i];
 				attr[i] = nil;
 				local ns, nm = k:match("^([^\1]*)\1?(.*)$");
-				if ns and nm then
+				if nm ~= "" then
 					ns = ns_prefixes[ns]; 
 					if ns then 
 						attr[ns..":"..nm] = attr[k];
@@ -105,7 +105,7 @@
 		end
 		function xml_handlers:EndElement(tagname)
 			local curr_ns,name = tagname:match("^([^\1]*)\1?(.*)$");
-			if not name then
+			if 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