diff options
author | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-03-02 02:57:49 +0100 |
---|---|---|
committer | Nick Wellnhofer <wellnhofer@aevum.de> | 2022-03-02 20:44:41 +0100 |
commit | bc06a522c10cbf491cfef4f82f169532e04044a1 (patch) | |
tree | e21e4b57de10b0649d17d20e399fff40634ff36e /xinclude.c | |
parent | 78d7a5ca3c7ab3939d24cc86622e7ba702bdd678 (diff) | |
download | libxml2-bc06a522c10cbf491cfef4f82f169532e04044a1.tar.gz |
Fix recursion check in xinclude.c
Compare the included URL with the document's URL to detect local
inclusions.
Fixes #348.
Diffstat (limited to 'xinclude.c')
-rw-r--r-- | xinclude.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -525,8 +525,6 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) { if (href == NULL) return(-1); } - if ((href[0] == '#') || (href[0] == 0)) - local = 1; parse = xmlXIncludeGetProp(ctxt, cur, XINCLUDE_PARSE); if (parse != NULL) { if (xmlStrEqual(parse, XINCLUDE_PARSE_XML)) @@ -623,6 +621,9 @@ xmlXIncludeAddNode(xmlXIncludeCtxtPtr ctxt, xmlNodePtr cur) { return(-1); } + if (xmlStrEqual(URL, ctxt->doc->URL)) + local = 1; + /* * If local and xml then we need a fragment */ |