mirror of
https://github.com/php/php-src.git
synced 2026-04-24 00:18:23 +02:00
Merge branch 'PHP-7.4'
* PHP-7.4: Fixed #75245 Don't set content of elements with only whitespaces
This commit is contained in:
@@ -45,7 +45,11 @@ PHP NEWS
|
||||
. Fixed bug #77800 (phpdbg segfaults on listing some conditional breakpoints).
|
||||
(krakjoe)
|
||||
. Fixed bug #77805 (phpdbg build fails when readline is shared). (krakjoe)
|
||||
|
||||
|
||||
- SimpleXML:
|
||||
. Fixed bug #75245 (Don't set content of elements with only whitespaces).
|
||||
(eriklundin)
|
||||
|
||||
- sodium:
|
||||
. Fixed bug #77646 (sign_detached() strings not terminated). (Frank)
|
||||
|
||||
|
||||
@@ -1206,7 +1206,7 @@ static HashTable *sxe_get_prop_hash(zend_object *object, int is_debug) /* {{{ */
|
||||
}
|
||||
|
||||
while (node) {
|
||||
if (node->children != NULL || node->prev != NULL || node->next != NULL) {
|
||||
if (node->children != NULL || node->prev != NULL || node->next != NULL || xmlIsBlankNode(node)) {
|
||||
SKIP_TEXT(node);
|
||||
} else {
|
||||
if (node->type == XML_TEXT_NODE) {
|
||||
|
||||
@@ -19,17 +19,9 @@ var_dump($clone->asXML());
|
||||
echo "Done\n";
|
||||
?>
|
||||
--EXPECTF--
|
||||
object(SimpleXMLElement)#%d (1) {
|
||||
[0]=>
|
||||
string(2) "
|
||||
|
||||
"
|
||||
object(SimpleXMLElement)#%d (0) {
|
||||
}
|
||||
object(SimpleXMLElement)#%d (1) {
|
||||
[0]=>
|
||||
string(2) "
|
||||
|
||||
"
|
||||
object(SimpleXMLElement)#%d (0) {
|
||||
}
|
||||
string(15) "<test>
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
--TEST--
|
||||
Bug #75245 Don't set content of elements with only whitespaces
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('simplexml')) die('skip simplexml not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
var_dump(simplexml_load_string('<test1><test2> </test2><test3></test3></test1>'));
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
object(SimpleXMLElement)#1 (2) {
|
||||
["test2"]=>
|
||||
object(SimpleXMLElement)#2 (0) {
|
||||
}
|
||||
["test3"]=>
|
||||
object(SimpleXMLElement)#3 (0) {
|
||||
}
|
||||
}
|
||||
===DONE===
|
||||
Reference in New Issue
Block a user