1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

added some code to check, when an include is done, whether the requested

* xinclude.c: added some code to check, when an include is
  done, whether the requested URL gets mapped to some other
  location (e.g. with a catalog entry) and, if so, take care
  of the xml:base properly (bug 146988)
This commit is contained in:
William M. Brack 2004-07-26 00:20:13 +00:00
parent cd3628b7dd
commit b85c9205f9
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,10 @@
Sun Jul 25 17:18:39 PDT 2004 William Brack <wbrack@mmm.com.hk>
* xinclude.c: added some code to check, when an include is
done, whether the requested URL gets mapped to some other
location (e.g. with a catalog entry) and, if so, take care
of the xml:base properly (bug 146988)
Sun Jul 25 14:02:24 PDT 2004 William Brack <wbrack@mmm.com.hk>
* error.c: fixed to assure user data param is set correctly

View File

@ -1459,6 +1459,16 @@ xmlXIncludeLoadDoc(xmlXIncludeCtxtPtr ctxt, const xmlChar *url, int nr) {
return(-1);
}
ctxt->incTab[nr]->doc = doc;
/*
* It's possible that the requested URL has been mapped to a
* completely different location (e.g. through a catalog entry).
* To check for this, we compare the URL with that of the doc
* and change it if they disagree (bug 146988).
*/
if (!xmlStrEqual(URL, doc->URL)) {
xmlFree(URL);
URL = xmlStrdup(doc->URL);
}
for (i = nr + 1; i < ctxt->incNr; i++) {
if (xmlStrEqual(URL, ctxt->incTab[i]->URI)) {
ctxt->incTab[nr]->count++;