cvs: php4 /ext/domxml php_domxml.c

From: Date: Thu, 20 Dec 2001 14:40:44 +0000
Subject: cvs: php4 /ext/domxml php_domxml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-8726@lists.php.net to get a copy of this message
mfischer Thu Dec 20 09:40:44 2001 EDT Modified files: /php4/ext/domxml php_domxml.c Log: - Fix crash with EntityRef nodes (and properly support them). Index: php4/ext/domxml/php_domxml.c diff -u php4/ext/domxml/php_domxml.c:1.89 php4/ext/domxml/php_domxml.c:1.90 --- php4/ext/domxml/php_domxml.c:1.89 Fri Dec 14 16:03:06 2001 +++ php4/ext/domxml/php_domxml.c Thu Dec 20 09:40:43 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_domxml.c,v 1.89 2001/12/14 21:03:06 mfischer Exp $ */ +/* $Id: php_domxml.c,v 1.90 2001/12/20 14:40:43 mfischer Exp $ */ #ifdef HAVE_CONFIG_H @@ -411,9 +411,14 @@ { while (node != NULL) { node_list_wrapper_dtor(node->children); - // FIXME temporary fix; think of something better - if (node->type != XML_ATTRIBUTE_DECL && node->type != XML_DTD_NODE) { - attr_list_wrapper_dtor(node->properties); + switch (node->type) { + /* Skip property freeing for the following types */ + case XML_ATTRIBUTE_DECL: + case XML_DTD_NODE: + case XML_ENTITY_DECL: + break; + default: + attr_list_wrapper_dtor(node->properties); } node_wrapper_dtor(node); node = node->next; @@ -817,7 +822,6 @@ xmlNodePtr nodep = obj; object_init_ex(wrapper, domxmlentityref_class_entry); rsrc_type = le_domxmlentityrefp; - content = xmlNodeGetContent(nodep); add_property_stringl(wrapper, "name", (char *) nodep->name, strlen(nodep->name), 1); break; } @@ -932,12 +936,12 @@ le_domxmlelementp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domelement", module_number); le_domxmldtdp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domdtd", module_number); le_domxmlcdatap = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domcdata", module_number); + le_domxmlentityrefp = zend_register_list_destructors_ex(php_free_xml_node, NULL, "domentityref", module_number); /* Not yet initialized le_*s */ le_domxmldoctypep = -10000; le_domxmlpip = -10002; le_domxmlnotationp = -10003; - le_domxmlentityrefp = -10004; #if defined(LIBXML_XPATH_ENABLED) le_xpathctxp = zend_register_list_destructors_ex(php_free_xpath_context, NULL, "xpathcontext", module_number);

« previous php.cvs (#8726) next »