. Fixed bug #79364 (When copy empty array, next key is unspecified). (cmb)
. Fixed bug #78210 (Invalid pointer address). (cmb, Nikita)
+- SimpleXML:
+ . Fixed bug #61597 (SXE properties may lack attributes and content). (cmb)
+
- Spl:
. Fixed bug #75673 (SplStack::unserialize() behavior). (cmb)
php_sxe_object *subnode;
xmlChar *contents;
- if (node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) {
+ if ((!node->properties || node->type == XML_ENTITY_DECL) && node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) {
contents = xmlNodeListGetString(node->doc, node->children, 1);
if (contents) {
ZVAL_STRING(value, (char *)contents);
["elem1"]=>
array(2) {
[0]=>
- string(36) "There is some text.Here is some more"
+ object(SimpleXMLElement)#%d (3) {
+ ["@attributes"]=>
+ array(2) {
+ ["attr1"]=>
+ string(5) "first"
+ ["attr2"]=>
+ string(6) "second"
+ }
+ ["comment"]=>
+ object(SimpleXMLElement)#%d (0) {
+ }
+ ["elem2"]=>
+ object(SimpleXMLElement)#%d (2) {
+ ["@attributes"]=>
+ array(2) {
+ ["att25"]=>
+ string(2) "25"
+ ["att42"]=>
+ string(2) "42"
+ }
+ ["elem3"]=>
+ object(SimpleXMLElement)#%d (1) {
+ ["elem4"]=>
+ object(SimpleXMLElement)#%d (1) {
+ ["test"]=>
+ object(SimpleXMLElement)#%d (0) {
+ }
+ }
+ }
+ }
+ }
[1]=>
object(SimpleXMLElement)#%d (1) {
["@attributes"]=>
string(5) "elem1"
}
["elem1"]=>
- string(10) "Bla bla 1."
+ object(SimpleXMLElement)#%d (3) {
+ ["@attributes"]=>
+ array(1) {
+ ["attr1"]=>
+ string(5) "first"
+ }
+ ["comment"]=>
+ object(SimpleXMLElement)#%d (0) {
+ }
+ ["elem2"]=>
+ string(35) "
+ Here we have some text data.
+ "
+ }
["elem11"]=>
- string(10) "Bla bla 2."
+ object(SimpleXMLElement)#%d (2) {
+ ["@attributes"]=>
+ array(1) {
+ ["attr2"]=>
+ string(6) "second"
+ }
+ [0]=>
+ string(10) "Bla bla 2."
+ }
}
===DONE===
Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in %s on line %d
Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in %s on line %d
-object(SimpleXMLElement)#%d (3) {
+object(SimpleXMLElement)#5 (3) {
["@attributes"]=>
array(2) {
["title"]=>
string(0) ""
}
[0]=>
- string(1) "x"
+ object(SimpleXMLElement)#4 (2) {
+ ["@attributes"]=>
+ array(2) {
+ ["title"]=>
+ string(0) ""
+ ["y"]=>
+ string(0) ""
+ }
+ [0]=>
+ string(1) "x"
+ }
[1]=>
- string(1) "x"
+ object(SimpleXMLElement)#6 (2) {
+ ["@attributes"]=>
+ array(2) {
+ ["title"]=>
+ string(0) ""
+ ["z"]=>
+ string(0) ""
+ }
+ [0]=>
+ string(1) "x"
+ }
}
string(0) ""
string(0) ""
--- /dev/null
+--TEST--
+Bug #61597 (SXE properties may lack attributes and content)
+--SKIPIF--
+<?php
+if (!extension_loaded('simplexml')) die('skip simplexml extension not available');
+?>
+--FILE--
+<?php
+$xml = <<<'EOX'
+<?xml version="1.0"?>
+<data>
+<datum file-key="8708124062829849862">corn</datum>
+</data>
+EOX;
+
+var_dump(simplexml_load_string($xml));
+?>
+--EXPECTF--
+object(SimpleXMLElement)#%d (1) {
+ ["datum"]=>
+ object(SimpleXMLElement)#%d (2) {
+ ["@attributes"]=>
+ array(1) {
+ ["file-key"]=>
+ string(19) "8708124062829849862"
+ }
+ [0]=>
+ string(4) "corn"
+ }
+}