[xml] loader obeying nonet flag again



Ran into another spot where the loader isn't obeying NONET flag.

When parsing with NONET and NOENT flags, xmlParseCtxtExternalEntity gets called. Attached patch has it call the xmlCreateEntityParserCtxtInternal function so that the origional context options are inherited. Outside of that change, by calling xmlCreateEntityParserCtxtInternal, it also passes the URL though the xmlBuildURI() function. If this is going to be an issue for anyone, I can keep current code and just have it set old context options; otherwise I'd like to commit this asap.

Rob
@@ -12066,31 +12066,15 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
     if ((URL == NULL) && (ID == NULL))
        return(-1);
     if (ctx->myDoc == NULL) /* @@ relax but check for dereferences */
        return(-1);
 
-    ctxt = xmlNewParserCtxt();
+    ctxt = xmlCreateEntityParserCtxtInternal(URL, ID, NULL, ctx);
     if (ctxt == NULL) {
        return(-1);
     }
 
-    ctxt->userData = ctxt;
-    ctxt->_private = ctx->_private;
-
-    inputStream = xmlLoadExternalEntity((char *)URL, (char *)ID, ctxt);
-    if (inputStream == NULL) {
-       xmlFreeParserCtxt(ctxt);
-       return(-1);
-    }
-
-    inputPush(ctxt, inputStream);
-
-    if ((ctxt->directory == NULL) && (directory == NULL))
-       directory = xmlParserGetDirectory((char *)URL);
-    if ((ctxt->directory == NULL) && (directory != NULL))
-       ctxt->directory = directory;
-
     oldsax = ctxt->sax;
     ctxt->sax = ctx->sax;
     xmlDetectSAX2(ctxt);
     newDoc = xmlNewDoc(BAD_CAST "1.0");
     if (newDoc == NULL) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]