php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #54354
Patch simplexml.c.patch revision 2011-04-26 23:07 UTC by tom at samplonius dot org
revision 2011-03-23 04:58 UTC by tom at samplonius dot org

Patch simplexml.c.patch for SimpleXML related Bug #54354

Patch version 2011-03-23 04:58 UTC

Return to Bug #54354 | Download this patch
Patch Revisions:

Developer: tom@samplonius.org

--- simplexml.c.orig	2011-03-22 18:29:33.000000000 -0700
+++ simplexml.c	2011-03-22 21:25:15.000000000 -0700
@@ -1619,12 +1619,14 @@
 		localname = xmlStrdup((xmlChar *)qname);
 	}
 
+	/* Add new child with no namespace */
 	newnode = xmlNewChild(node, NULL, localname, (xmlChar *)value);
 
 	if (nsuri != NULL) {
+		/* If namespace is not NULL but blank, use no namespace
+		   Use this to prevent inheriting the name space of the parent */
 		if (nsuri_len == 0) {
 			newnode->ns = NULL;
-			nsptr = xmlNewNs(newnode, (xmlChar *)nsuri, prefix);
 		} else {
 			nsptr = xmlSearchNsByHref(node->doc, node, (xmlChar *)nsuri);
 			if (nsptr == NULL) {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 02:01:29 2024 UTC