summaryrefslogtreecommitdiff
path: root/ext/simplexml/simplexml.c
diff options
context:
space:
mode:
authorRob Richards <rrichards@php.net>2007-07-03 14:55:53 +0000
committerRob Richards <rrichards@php.net>2007-07-03 14:55:53 +0000
commitd6756845e803ca92bcbc96243d7fccf00d181910 (patch)
tree55b39040060e2df777534e2074ba5403ebaf31d4 /ext/simplexml/simplexml.c
parente99013d039b5f1d012237a1f8bea5c5cd9622bf4 (diff)
downloadphp-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.c5
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;
}
}
/* }}} */