diff options
| author | Rob Richards <rrichards@php.net> | 2007-07-03 14:55:53 +0000 |
|---|---|---|
| committer | Rob Richards <rrichards@php.net> | 2007-07-03 14:55:53 +0000 |
| commit | d6756845e803ca92bcbc96243d7fccf00d181910 (patch) | |
| tree | 55b39040060e2df777534e2074ba5403ebaf31d4 /ext/simplexml/simplexml.c | |
| parent | e99013d039b5f1d012237a1f8bea5c5cd9622bf4 (diff) | |
| download | php-git-d6756845e803ca92bcbc96243d7fccf00d181910.tar.gz | |
fix bug #41861 (getNamespaces() returns namespaces of node's siblings)
add test
Diffstat (limited to 'ext/simplexml/simplexml.c')
| -rw-r--r-- | ext/simplexml/simplexml.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 5c7cd60e5c..04fc95ea06 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -1396,15 +1396,12 @@ SXE_METHOD(getNamespaces) GET_NODE(sxe, node); node = php_sxe_get_first_node(sxe, node TSRMLS_CC); - while (node) { - SKIP_TEXT(node) + if (node) { if (node->type == XML_ELEMENT_NODE) { sxe_add_namespaces(sxe, node, recursive, return_value TSRMLS_CC); } else if (node->type == XML_ATTRIBUTE_NODE && node->ns) { sxe_add_namespace_name(return_value, node->ns); } -next_iter: - node = node->next; } } /* }}} */ |
