Skip to content

Commit 9b9252c

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
2 parents 7e14e03 + 54148fd commit 9b9252c

File tree

6 files changed

+12
-108
lines changed

6 files changed

+12
-108
lines changed

NEWS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
PHP NEWS
22
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3+
?? ??? ????, PHP 7.4.7
4+
5+
- SimpleXML:
6+
. Fixed bug #79528 (Different object of the same xml between 7.4.5 and
7+
7.4.4). (cmb)
38

49
?? ??? ????, PHP 7.4.6
510

ext/simplexml/simplexml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval
981981
php_sxe_object *subnode;
982982
xmlChar *contents;
983983

984-
if ((!node->properties || node->type == XML_ENTITY_DECL) && node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) {
984+
if (node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) {
985985
contents = xmlNodeListGetString(node->doc, node->children, 1);
986986
if (contents) {
987987
ZVAL_STRING(value, (char *)contents);

ext/simplexml/tests/000.phpt

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

ext/simplexml/tests/009b.phpt

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

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)