From: Sterling Hughes Date: Mon, 30 Jun 2003 03:08:48 +0000 (+0000) Subject: satisfy my very first user :) X-Git-Tag: BEFORE_ARG_INFO~543 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2505cf7c2cfc07d5759a9c440dff692639bc5c76;p=php satisfy my very first user :) --- diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index 35fc724c21..67e974cedd 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -84,7 +84,18 @@ _node_as_zval(php_sxe_object *sxe, xmlNodePtr node, zval *value TSRMLS_DC) static inline int match_ns(php_sxe_object *sxe, xmlNodePtr node, xmlChar *name) { - if (!xmlStrcmp(node->ns->prefix, name) || !xmlStrcmp((xmlChar *) xmlHashLookup(sxe->nsmap, node->ns->href), name)) { + xmlChar *prefix; + + prefix = xmlHashLookup(sxe->nsmap, node->ns->href); + if (prefix == NULL) { + prefix = node->ns->prefix; + } + + if (prefix == NULL) { + return 0; + } + + if (!xmlStrcmp(prefix, name)) { return 1; } @@ -139,7 +150,7 @@ sxe_property_read(zval *object, zval *member TSRMLS_DC) if (node->ns) { if (node->parent->ns) { if (!xmlStrcmp(node->ns->href, node->parent->ns->href)) { - goto next_iter; + goto this_iter; } } @@ -150,6 +161,7 @@ sxe_property_read(zval *object, zval *member TSRMLS_DC) goto next_iter; } } +this_iter: if (!xmlStrcmp(node->name, name)) { APPEND_PREV_ELEMENT(counter, value);