[libxml2] Stop calling SAX getEntity handler from XMLReader



commit c005c7a0f71fd14ea96e5906130f83dc718f52aa
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Tue Feb 11 16:35:20 2020 +0100

    Stop calling SAX getEntity handler from XMLReader
    
    The getEntity handler was already invoked by xmlParseReference, so it's
    useless to call it again. After the recent change, xmlSAX2GetEntity
    won't load any kind of entities anyway.

 xmlreader.c | 21 ---------------------
 1 file changed, 21 deletions(-)
---
diff --git a/xmlreader.c b/xmlreader.c
index e336bc71..740ba0b9 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -1106,20 +1106,9 @@ static void
 xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
     xmlNodePtr oldnode = reader->node;
     xmlNodePtr node = reader->node;
-    xmlParserCtxtPtr ctxt = reader->ctxt;
 
     do {
        if (node->type == XML_ENTITY_REF_NODE) {
-           /*
-            * Case where the underlying tree is not available, lookup the entity
-            * and walk it.
-            */
-           if ((node->children == NULL) && (ctxt->sax != NULL) &&
-               (ctxt->sax->getEntity != NULL)) {
-               node->children = (xmlNodePtr)
-                   ctxt->sax->getEntity(ctxt, node->name);
-           }
-
            if ((node->children != NULL) &&
                (node->children->type == XML_ENTITY_DECL) &&
                (node->children->children != NULL)) {
@@ -1564,16 +1553,6 @@ node_found:
     if ((reader->node != NULL) &&
        (reader->node->type == XML_ENTITY_REF_NODE) &&
        (reader->ctxt != NULL) && (reader->ctxt->replaceEntities == 1)) {
-       /*
-        * Case where the underlying tree is not available, lookup the entity
-        * and walk it.
-        */
-       if ((reader->node->children == NULL) && (reader->ctxt->sax != NULL) &&
-           (reader->ctxt->sax->getEntity != NULL)) {
-           reader->node->children = (xmlNodePtr)
-               reader->ctxt->sax->getEntity(reader->ctxt, reader->node->name);
-       }
-
        if ((reader->node->children != NULL) &&
            (reader->node->children->type == XML_ENTITY_DECL) &&
            (reader->node->children->children != NULL)) {


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