summaryrefslogtreecommitdiff
path: root/ext/simplexml/simplexml.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-03-07 11:20:06 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2020-03-12 10:52:28 +0100
commit7c081db885756d7b176a55b90b8746f664d1e042 (patch)
tree421abd97ba8b8af28312fdde4490f105b5d624f4 /ext/simplexml/simplexml.c
parent53797c206a4304e0c322c39cb02abf891429367e (diff)
downloadphp-git-7c081db885756d7b176a55b90b8746f664d1e042.tar.gz
Fix #61597: SXE properties may lack attributes and content
We must not treat a node as string if it has attributes, unless it is an entity declaration which is always treated as string by simplexml.
Diffstat (limited to 'ext/simplexml/simplexml.c')
-rw-r--r--ext/simplexml/simplexml.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index ab394b5c83..a27a9849a3 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -964,7 +964,7 @@ static void _get_base_node_value(php_sxe_object *sxe_ref, xmlNodePtr node, zval
php_sxe_object *subnode;
xmlChar *contents;
- if (node->children && node->children->type == XML_TEXT_NODE && !xmlIsBlankNode(node->children)) {
+ if ((!node->properties || node->type == XML_ENTITY_DECL) && 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);