diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-05-01 12:42:09 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-05-01 12:42:09 +0200 |
commit | 1d2044367978f468720f2f76622e6ee0ed849b75 (patch) | |
tree | 4c58ff13d9723bcddcac9a64363eb8823f81e888 | |
parent | 7b32d176d2ef6f144083f1df15f5b15500f40447 (diff) | |
parent | 9b9252c6675e05f01d0788fcb7138a5c277610ca (diff) | |
download | php-git-1d2044367978f468720f2f76622e6ee0ed849b75.tar.gz |
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix #79528: Different object of the same xml between 7.4.5 and 7.4.4
-rw-r--r-- | ext/simplexml/simplexml.c | 2 | ||||
-rw-r--r-- | ext/simplexml/tests/000.phpt | 32 | ||||
-rw-r--r-- | ext/simplexml/tests/009b.phpt | 25 | ||||
-rw-r--r-- | ext/simplexml/tests/bug51615.phpt | 26 | ||||
-rw-r--r-- | ext/simplexml/tests/bug61597.phpt | 30 |
5 files changed, 7 insertions, 108 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 5f23c48026..58a18d3c0d 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -990,7 +990,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); diff --git a/ext/simplexml/tests/000.phpt b/ext/simplexml/tests/000.phpt index 97a02922ba..453865ef34 100644 --- a/ext/simplexml/tests/000.phpt +++ b/ext/simplexml/tests/000.phpt @@ -49,37 +49,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"]=> diff --git a/ext/simplexml/tests/009b.phpt b/ext/simplexml/tests/009b.phpt index 6909a03446..bc651fe744 100644 --- a/ext/simplexml/tests/009b.phpt +++ b/ext/simplexml/tests/009b.phpt @@ -26,28 +26,7 @@ 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." } diff --git a/ext/simplexml/tests/bug51615.phpt b/ext/simplexml/tests/bug51615.phpt index 785089c477..d5759b21fc 100644 --- a/ext/simplexml/tests/bug51615.phpt +++ b/ext/simplexml/tests/bug51615.phpt @@ -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"]=> @@ -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) "" diff --git a/ext/simplexml/tests/bug61597.phpt b/ext/simplexml/tests/bug61597.phpt deleted file mode 100644 index 65fa6be772..0000000000 --- a/ext/simplexml/tests/bug61597.phpt +++ /dev/null @@ -1,30 +0,0 @@ ---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" - } -} |