1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-20 18:50:08 +03:00

xinclude: Only set xml:base if necessary

This commit is contained in:
Nick Wellnhofer 2023-12-28 16:42:03 +01:00
parent 8a685a3dfc
commit 2a2fbe1e5b

View File

@ -628,7 +628,10 @@ xmlXIncludeBaseFixup(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur, xmlNodePtr copy,
goto done;
}
if (relBase[0] != 0) {
/*
* If the new base doesn't contain a slash, it can be omitted.
*/
if (xmlStrchr(relBase, '/') != NULL) {
res = xmlNodeSetBase(copy, relBase);
if (res < 0)
xmlXIncludeErrMemory(ctxt);