Skip to content

Commit

Permalink
Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
Browse files Browse the repository at this point in the history
Revert "Fix #61597: SXE properties may lack attributes and content"

This reverts commit 7c081db.

(cherry picked from commit 54148fd)
  • Loading branch information
cmb69 committed May 1, 2020
1 parent 830e566 commit cb265a0
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 108 deletions.
6 changes: 6 additions & 0 deletions NEWS
@@ -1,5 +1,11 @@
PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? ????, PHP 7.3.18

- SimpleXML:
. Fixed bug #79528 (Different object of the same xml between 7.4.5 and
7.4.4). (cmb)

30 Apr 2020, PHP 7.3.18RC1

- Core:
Expand Down
2 changes: 1 addition & 1 deletion ext/simplexml/simplexml.c
Expand Up @@ -964,7 +964,7 @@ static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval
php_sxe_object *subnode;
xmlChar *contents;

if ((!node->properties || node->type == XML_ENTITY_DECL) && node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) {
if (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);
Expand Down
32 changes: 1 addition & 31 deletions ext/simplexml/tests/000.phpt
Expand Up @@ -51,37 +51,7 @@ object(SimpleXMLElement)#%d (3) {
["elem1"]=>
array(2) {
[0]=>
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) {
}
}
}
}
}
string(36) "There is some text.Here is some more"
[1]=>
object(SimpleXMLElement)#%d (1) {
["@attributes"]=>
Expand Down
25 changes: 2 additions & 23 deletions ext/simplexml/tests/009b.phpt
Expand Up @@ -28,29 +28,8 @@ object(SimpleXMLElement)#%d (3) {
string(5) "elem1"
}
["elem1"]=>
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.
"
}
string(10) "Bla bla 1."
["elem11"]=>
object(SimpleXMLElement)#%d (2) {
["@attributes"]=>
array(1) {
["attr2"]=>
string(6) "second"
}
[0]=>
string(10) "Bla bla 2."
}
string(10) "Bla bla 2."
}
===DONE===
26 changes: 3 additions & 23 deletions ext/simplexml/tests/bug51615.phpt
Expand Up @@ -22,7 +22,7 @@ foreach ($html->body->span as $obj) {
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)#5 (3) {
object(SimpleXMLElement)#%d (3) {
["@attributes"]=>
array(2) {
["title"]=>
Expand All @@ -31,29 +31,9 @@ object(SimpleXMLElement)#5 (3) {
string(0) ""
}
[0]=>
object(SimpleXMLElement)#4 (2) {
["@attributes"]=>
array(2) {
["title"]=>
string(0) ""
["y"]=>
string(0) ""
}
[0]=>
string(1) "x"
}
string(1) "x"
[1]=>
object(SimpleXMLElement)#6 (2) {
["@attributes"]=>
array(2) {
["title"]=>
string(0) ""
["z"]=>
string(0) ""
}
[0]=>
string(1) "x"
}
string(1) "x"
}
string(0) ""
string(0) ""
30 changes: 0 additions & 30 deletions ext/simplexml/tests/bug61597.phpt

This file was deleted.

0 comments on commit cb265a0

Please sign in to comment.