cvs: php-src /ext/simplexml simplexml.c /ext/simplexml/tests 023.phpt

From: Date: Sun, 23 Oct 2005 23:41:20 +0000
Subject: cvs: php-src /ext/simplexml simplexml.c /ext/simplexml/tests 023.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-34746@lists.php.net to get a copy of this message
helly Sun Oct 23 19:41:20 2005 EDT Modified files: /php-src/ext/simplexml simplexml.c /php-src/ext/simplexml/tests 023.phpt Log: - Fix issue with entities in attributes http://cvs.php.net/diff.php/php-src/ext/simplexml/simplexml.c?r1=1.163&r2=1.164&ty=u Index: php-src/ext/simplexml/simplexml.c diff -u php-src/ext/simplexml/simplexml.c:1.163 php-src/ext/simplexml/simplexml.c:1.164 --- php-src/ext/simplexml/simplexml.c:1.163 Thu Oct 6 02:27:27 2005 +++ php-src/ext/simplexml/simplexml.c Sun Oct 23 19:41:18 2005 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: simplexml.c,v 1.163 2005/10/06 06:27:27 dmitry Exp $ */ +/* $Id: simplexml.c,v 1.164 2005/10/23 23:41:18 helly Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -701,7 +701,14 @@ node = php_sxe_get_first_node(sxe, node TSRMLS_CC); if (node) { - node = node->children; + if (node->type == XML_ATTRIBUTE_NODE) { + MAKE_STD_ZVAL(value); + ZVAL_U_STRING(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), value, xmlNodeListGetString(node->doc, node->children, 1), 1); + zend_hash_next_index_insert(rv, &value, sizeof(zval *), NULL); + node = NULL; + } else { + node = node->children; + } while (node) { if (node->children != NULL || node->prev != NULL || node->next != NULL) { @@ -1757,7 +1764,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, "Simplexml support", "enabled"); - php_info_print_table_row(2, "Revision", "$Revision: 1.163 $"); + php_info_print_table_row(2, "Revision", "$Revision: 1.164 $"); php_info_print_table_row(2, "Schema support", #ifdef LIBXML_SCHEMAS_ENABLED "enabled"); http://cvs.php.net/diff.php/php-src/ext/simplexml/tests/023.phpt?r1=1.1&r2=1.2&ty=u Index: php-src/ext/simplexml/tests/023.phpt diff -u php-src/ext/simplexml/tests/023.phpt:1.1 php-src/ext/simplexml/tests/023.phpt:1.2 --- php-src/ext/simplexml/tests/023.phpt:1.1 Sun Oct 23 19:25:46 2005 +++ php-src/ext/simplexml/tests/023.phpt Sun Oct 23 19:41:20 2005 @@ -22,11 +22,9 @@ ?> ===DONE=== --EXPECTF-- -object(SimpleXMLElement)#1 (1) { - ["attr"]=> - string(%d) "foo%sbar%sbaz" +object(SimpleXMLElement)#%d (0) { } -object(SimpleXMLElement)#2 (1) { +object(SimpleXMLElement)#%d (1) { [0]=> string(%d) "foo%sbar%sbaz" }

« previous php.cvs (#34746) next »