From 406c2156d175a2e8005208ad36e8e01289821168 Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Thu, 8 Jan 2004 22:40:08 +0000 Subject: [PATCH] Fix dumping, when dumping a text element, for example: helly sterling '); var_dump($doc->name[0]->first); Used to not display the node's content, now it does. --- ext/simplexml/simplexml.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 1559f8b115d..9092af8267d 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -592,8 +592,17 @@ sxe_properties_get(zval *object TSRMLS_DC) node = node->children; while (node) { - SKIP_TEXT(node); - + if (node->children != NULL || node->prev != NULL || node->next != NULL) { + SKIP_TEXT(node); + } else { + if (node->type == XML_TEXT_NODE) { + MAKE_STD_ZVAL(value); + ZVAL_STRING(value, xmlNodeListGetString(node->doc, node, 1), 1); + zend_hash_next_index_insert(rv, &value, sizeof(zval *), NULL); + goto next_iter; + } + } + name = (char *) node->name; if (!name) { goto next_iter;