Skip to content

Commit 1d20443

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
2 parents 7b32d17 + 9b9252c commit 1d20443

File tree

5 files changed

+7
-108
lines changed

5 files changed

+7
-108
lines changed

ext/simplexml/simplexml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -990,7 +990,7 @@ static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval
990990
php_sxe_object *subnode;
991991
xmlChar *contents;
992992

993-
if ((!node->properties || node->type == XML_ENTITY_DECL) && node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) {
993+
if (node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) {
994994
contents = xmlNodeListGetString(node->doc, node->children, 1);
995995
if (contents) {
996996
ZVAL_STRING(value, (char *)contents);

ext/simplexml/tests/000.phpt

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -49,37 +49,7 @@ object(SimpleXMLElement)#%d (3) {
4949
["elem1"]=>
5050
array(2) {
5151
[0]=>
52-
object(SimpleXMLElement)#%d (3) {
53-
["@attributes"]=>
54-
array(2) {
55-
["attr1"]=>
56-
string(5) "first"
57-
["attr2"]=>
58-
string(6) "second"
59-
}
60-
["comment"]=>
61-
object(SimpleXMLElement)#%d (0) {
62-
}
63-
["elem2"]=>
64-
object(SimpleXMLElement)#%d (2) {
65-
["@attributes"]=>
66-
array(2) {
67-
["att25"]=>
68-
string(2) "25"
69-
["att42"]=>
70-
string(2) "42"
71-
}
72-
["elem3"]=>
73-
object(SimpleXMLElement)#%d (1) {
74-
["elem4"]=>
75-
object(SimpleXMLElement)#%d (1) {
76-
["test"]=>
77-
object(SimpleXMLElement)#%d (0) {
78-
}
79-
}
80-
}
81-
}
82-
}
52+
string(36) "There is some text.Here is some more"
8353
[1]=>
8454
object(SimpleXMLElement)#%d (1) {
8555
["@attributes"]=>

ext/simplexml/tests/009b.phpt

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,7 @@ object(SimpleXMLElement)#%d (3) {
2626
string(5) "elem1"
2727
}
2828
["elem1"]=>
29-
object(SimpleXMLElement)#%d (3) {
30-
["@attributes"]=>
31-
array(1) {
32-
["attr1"]=>
33-
string(5) "first"
34-
}
35-
["comment"]=>
36-
object(SimpleXMLElement)#%d (0) {
37-
}
38-
["elem2"]=>
39-
string(35) "
40-
Here we have some text data.
41-
"
42-
}
29+
string(10) "Bla bla 1."
4330
["elem11"]=>
44-
object(SimpleXMLElement)#%d (2) {
45-
["@attributes"]=>
46-
array(1) {
47-
["attr2"]=>
48-
string(6) "second"
49-
}
50-
[0]=>
51-
string(10) "Bla bla 2."
52-
}
31+
string(10) "Bla bla 2."
5332
}

ext/simplexml/tests/bug51615.phpt

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ foreach ($html->body->span as $obj) {
2222
Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in %s on line %d
2323

2424
Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in %s on line %d
25-
object(SimpleXMLElement)#5 (3) {
25+
object(SimpleXMLElement)#%d (3) {
2626
["@attributes"]=>
2727
array(2) {
2828
["title"]=>
@@ -31,29 +31,9 @@ object(SimpleXMLElement)#5 (3) {
3131
string(0) ""
3232
}
3333
[0]=>
34-
object(SimpleXMLElement)#4 (2) {
35-
["@attributes"]=>
36-
array(2) {
37-
["title"]=>
38-
string(0) ""
39-
["y"]=>
40-
string(0) ""
41-
}
42-
[0]=>
43-
string(1) "x"
44-
}
34+
string(1) "x"
4535
[1]=>
46-
object(SimpleXMLElement)#6 (2) {
47-
["@attributes"]=>
48-
array(2) {
49-
["title"]=>
50-
string(0) ""
51-
["z"]=>
52-
string(0) ""
53-
}
54-
[0]=>
55-
string(1) "x"
56-
}
36+
string(1) "x"
5737
}
5838
string(0) ""
5939
string(0) ""

ext/simplexml/tests/bug61597.phpt

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)