Fixed #67474 (getElementsByTagNameNS and default namespace)

This bug was caused by the fact that dom_get_elements_by_tag_name_ns_raw
uses an empty string to filter on the default namespace (as NULL means
'no filter'), whereas in the node itself the default namespace is
signalled by nodep->ns being null.
This commit is contained in:
Arnout Boks 2017-01-02 11:47:49 +01:00 committed by Joe Watkins
parent 19c4a2ef19
commit a8955926c2
No known key found for this signature in database
GPG key ID: F9BA0ADA31CBD89E

View file

@ -1345,7 +1345,7 @@ xmlNode *dom_get_elements_by_tag_name_ns_raw(xmlNodePtr nodep, char *ns, char *l
while (nodep != NULL && (*cur <= index || index == -1)) { while (nodep != NULL && (*cur <= index || index == -1)) {
if (nodep->type == XML_ELEMENT_NODE) { if (nodep->type == XML_ELEMENT_NODE) {
if (xmlStrEqual(nodep->name, (xmlChar *)local) || xmlStrEqual((xmlChar *)"*", (xmlChar *)local)) { if (xmlStrEqual(nodep->name, (xmlChar *)local) || xmlStrEqual((xmlChar *)"*", (xmlChar *)local)) {
if (ns == NULL || (nodep->ns != NULL && (xmlStrEqual(nodep->ns->href, (xmlChar *)ns) || xmlStrEqual((xmlChar *)"*", (xmlChar *)ns)))) { if (ns == NULL || (!strcmp(ns, "") && nodep->ns == NULL) || (nodep->ns != NULL && (xmlStrEqual(nodep->ns->href, (xmlChar *)ns) || xmlStrEqual((xmlChar *)"*", (xmlChar *)ns)))) {
if (*cur == index) { if (*cur == index) {
ret = nodep; ret = nodep;
break; break;