Apache Lucene open-source search software
SOLR-4881: Fix DocumentAnalysisRequestHandler to correctly use EmptyEntityResolver to prevent loading of external entities like UpdateRequestHandler does
Uwe Schindler7239a57a51ea
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 385ca627a4f..e022c2e3339 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -216,6 +216,10 @@ Bug Fixescase for handling TermQuery to prevent NullPointerException if reader doesnot have fields. (Bao Yang Yang, Uwe Schindler)+* SOLR-4881: Fix DocumentAnalysisRequestHandler to correctly use+ EmptyEntityResolver to prevent loading of external entities like+ UpdateRequestHandler does. (Hossman, Uwe Schindler)+Other Changes----------------------diff --git a/solr/core/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.javaindex c1602a05fdf..6e8c53ae7d3 100644--- a/solr/core/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java+++ b/solr/core/src/java/org/apache/solr/handler/DocumentAnalysisRequestHandler.java@@ -35,6 +35,7 @@ import org.apache.solr.request.SolrQueryRequest;import org.apache.solr.schema.FieldType;import org.apache.solr.schema.IndexSchema;import org.apache.solr.schema.SchemaField;+import org.apache.solr.util.EmptyEntityResolver;import org.slf4j.Logger;import org.slf4j.LoggerFactory;@@ -90,6 +91,8 @@ public class DocumentAnalysisRequestHandler extends AnalysisRequestHandlerBase {super.init(args);inputFactory = XMLInputFactory.newInstance();+ EmptyEntityResolver.configureXMLInputFactory(inputFactory);+ inputFactory.setXMLReporter(xmllog);try {// The java 1.6 bundled stax parser (sjsxp) does not currently have a thread-safe// XMLInputFactory, as that implementation tries to cache and reuse the@@ -103,7 +106,6 @@ public class DocumentAnalysisRequestHandler extends AnalysisRequestHandlerBase {// isimplementation specific.log.debug("Unable to set the 'reuse-instance' property for the input factory: " + inputFactory);}- inputFactory.setXMLReporter(xmllog);}/**