parser: Make XML_PARSE_NSCLEAN option work again

This commit is contained in:
Nick Wellnhofer 2023-10-05 23:52:55 +02:00
parent 0ba22c0513
commit 7615fae62e

View File

@ -1685,6 +1685,10 @@ xmlParserNsPush(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix,
xmlErrAttributeDup(ctxt, NULL, BAD_CAST "xmlns");
return(0);
}
if ((ctxt->options & XML_PARSE_NSCLEAN) &&
(uri->name == ctxt->nsTab[oldIndex * 2 + 1]))
return(0);
}
ctxt->nsdb->defaultNsIndex = ctxt->nsNr;
@ -1709,6 +1713,10 @@ xmlParserNsPush(xmlParserCtxtPtr ctxt, const xmlHashedString *prefix,
return(0);
}
if ((ctxt->options & XML_PARSE_NSCLEAN) &&
(uri->name == ctxt->nsTab[bucket->index * 2 + 1]))
return(0);
bucket->index = ctxt->nsNr;
goto populate_entry;
}