com php-src: Fix libxml/sxe/dom node import/export: ext/dom/php_dom.c ext/libxml/libxml.c ext/simplexml/s implexml.c

From: Date: Thu, 17 Apr 2014 22:15:13 +0000
Subject: com php-src: Fix libxml/sxe/dom node import/export: ext/dom/php_dom.c ext/libxml/libxml.c ext/simplexml/s implexml.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77346@lists.php.net to get a copy of this message
Commit: 59d45e69f4a24935719230cea3d25a0c9701511e Author: Nikita Popov <nikic@php.net> Thu, 17 Apr 2014 23:29:35 +0200 Parents: 3434d3fc98881ee5cd45b2b57afc789fd69b810b Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=59d45e69f4a24935719230cea3d25a0c9701511e Log: Fix libxml/sxe/dom node import/export Also fix sxe zts. Changed paths: M ext/dom/php_dom.c M ext/libxml/libxml.c M ext/simplexml/simplexml.c Diff: diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index c51be7f..99d99e2 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -477,7 +477,7 @@ void *php_dom_export_node(zval *object TSRMLS_DC) /* {{{ */ php_libxml_node_object *intern; xmlNodePtr nodep = NULL; - intern = Z_DOMOBJ_P(object); + intern = (php_libxml_node_object *) Z_DOMOBJ_P(object); if (intern->node) { nodep = intern->node->node; } @@ -499,7 +499,7 @@ PHP_FUNCTION(dom_import_simplexml) return; } - nodeobj = Z_DOMOBJ_P(node); + nodeobj = (php_libxml_node_object *) ((char *) Z_OBJ_P(node) - Z_OBJ_HT_P(node)->offset); nodep = php_libxml_import_node(node TSRMLS_CC); if (nodep && nodeobj && (nodep->type == XML_ELEMENT_NODE || nodep->type == XML_ATTRIBUTE_NODE)) { diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 705045e..d399f72 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -1152,7 +1152,7 @@ PHP_LIBXML_API xmlNodePtr php_libxml_import_node(zval *object TSRMLS_DC) while (ce->parent != NULL) { ce = ce->parent; } - if ((export_hnd = zend_hash_find_ptr(&php_libxml_exports, ce->name)) == SUCCESS) { + if ((export_hnd = zend_hash_find_ptr(&php_libxml_exports, ce->name))) { node = export_hnd->export_func(object TSRMLS_CC); } } diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 5d5d9c6..1c6a20c 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -971,7 +971,7 @@ static void sxe_dimension_delete(zval *object, zval *offset TSRMLS_DC) } /* }}} */ -static inline zend_string * sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine) /* {{{ */ +static inline zend_string *sxe_xmlNodeListGetString(xmlDocPtr doc, xmlNodePtr list, int inLine TSRMLS_DC) /* {{{ */ { xmlChar *tmp = xmlNodeListGetString(doc, list, inLine); zend_string *res; @@ -1085,7 +1085,7 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{ test = sxe->iter.name && sxe->iter.type == SXE_ITER_ATTRLIST; while (attr) { if ((!test || !xmlStrcmp(attr->name, sxe->iter.name)) && match_ns(sxe, (xmlNodePtr)attr, sxe->iter.nsprefix, sxe->iter.isprefix)) { - ZVAL_STR(&value, sxe_xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, attr->children, 1)); + ZVAL_STR(&value, sxe_xmlNodeListGetString((xmlDocPtr) sxe->document->ptr, attr->children, 1 TSRMLS_CC)); namelen = xmlStrlen(attr->name); if (ZVAL_IS_UNDEF(&zattr)) { array_init(&zattr); @@ -1103,7 +1103,7 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{ if (node && sxe->iter.type != SXE_ITER_ATTRLIST) { if (node->type == XML_ATTRIBUTE_NODE) { - ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node->children, 1)); + ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node->children, 1 TSRMLS_CC)); zend_hash_next_index_insert(rv, &value); node = NULL; } else if (sxe->iter.type != SXE_ITER_CHILD) { @@ -1128,7 +1128,7 @@ static HashTable *sxe_get_prop_hash(zval *object, int is_debug TSRMLS_DC) /* {{{ const xmlChar *cur = node->content; if (*cur != 0) { - ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node, 1)); + ZVAL_STR(&value, sxe_xmlNodeListGetString(node->doc, node, 1 TSRMLS_CC)); zend_hash_next_index_insert(rv, &value); } goto next_iter; @@ -2384,7 +2384,7 @@ PHP_FUNCTION(simplexml_import_dom) return; } - object = (php_libxml_node_object *)Z_SXEOBJ_P(node); + object = (php_libxml_node_object *) ((char *) Z_OBJ_P(node) - Z_OBJ_HT_P(node)->offset); nodep = php_libxml_import_node(node TSRMLS_CC);

« previous php.cvs (#77346) next »