davidc Wed Feb 4 00:07:27 2009 UTC
Modified files:
/php-src/ext/simplexml simplexml.c
/php-src/ext/simplexml/tests bug46048.phpt
Log:
- MFB (Fixed Bug #46048: SimpleXML top-level @attributes not in iterator).
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/simplexml.c?r1=1.271&r2=1.272&diff_format=u
Index: php-src/ext/simplexml/simplexml.c
diff -u php-src/ext/simplexml/simplexml.c:1.271
php-src/ext/simplexml/simplexml.c:1.272
--- php-src/ext/simplexml/simplexml.c:1.271 Wed Dec 31 11:12:35 2008
+++ php-src/ext/simplexml/simplexml.c Wed Feb 4 00:07:27 2009
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: simplexml.c,v 1.271 2008/12/31 11:12:35 sebastian Exp $ */
+/* $Id: simplexml.c,v 1.272 2009/02/04 00:07:27 davidc Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -1081,7 +1081,7 @@
if (!node) {
return rv;
}
- if (is_debug) {
+ if (is_debug || sxe->iter.type != SXE_ITER_CHILD) {
if (sxe->iter.type == SXE_ITER_ELEMENT) {
node = php_sxe_get_first_node(sxe, node TSRMLS_CC);
}
@@ -2634,7 +2634,7 @@
{
php_info_print_table_start();
php_info_print_table_header(2, "Simplexml support", "enabled");
- php_info_print_table_row(2, "Revision", "$Revision: 1.271 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.272 $");
php_info_print_table_row(2, "Schema support",
#ifdef LIBXML_SCHEMAS_ENABLED
"enabled");
http://cvs.php.net/viewvc.cgi/php-src/ext/simplexml/tests/bug46048.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/simplexml/tests/bug46048.phpt
diff -u /dev/null php-src/ext/simplexml/tests/bug46048.phpt:1.2
--- /dev/null Wed Feb 4 00:07:27 2009
+++ php-src/ext/simplexml/tests/bug46048.phpt Wed Feb 4 00:07:27 2009
@@ -0,0 +1,24 @@
+--TEST--
+Bug #46048 (SimpleXML top-level @attributes not part of iterator)
+--FILE--
+<?php
+$xml = '
+<data id="1">
+ <key>value</key>
+</data>
+';
+$obj = simplexml_load_string($xml);
+print_r(get_object_vars($obj));
+echo "Done\n";
+?>
+--EXPECT--
+Array
+(
+ [...@attributes] => Array
+ (
+ [id] => 1
+ )
+
+ [key] => value
+)
+Done
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php