You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix bug #70570: json_encode and var_dump ignore simplexml cdata
XML_CDATA_SECTION_NODE was simply not handled, handle it the same way as
we handle text nodes for consistency reasons.
We introduce the php_sxe_is_inclusive_text_node() helper for text-like
nodes. In DOM parlance, these 2 types are called inclusive text nodes.
Unfortunately, the fact that we handle CData the same as text now has a
technical BC break.
Previously this XML:
```
<?xml version="1.0" encoding="UTF-8"?>
<container>
<C><![CDATA[hello]]><foo/><![CDATA[world]]></C>
</container>
```
resulted in this var_dump output:
```
object(SimpleXMLElement)#1 (1) {
["C"]=>
object(SimpleXMLElement)#2 (1) {
["foo"]=>
object(SimpleXMLElement)#3 (0) {
}
}
}
```
However, after this patch (as text is not an element and thus handled
specially) we get the following output:
```
object(SimpleXMLElement)#1 (1) {
["C"]=>
string(10) "helloworld"
}
```
0 commit comments