SOLR-4881: Fix DocumentAnalysisRequestHandler to correctly use EmptyEntityResolver to prevent loading of external entities like UpdateRequestHandler does

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1487976 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2013-05-30 18:58:58 +00:00
parent fecb6fb0a2
commit 7239a57a51
2 changed files with 7 additions and 1 deletions

View File

@ -216,6 +216,10 @@ Bug Fixes
case for handling TermQuery to prevent NullPointerException if reader does
not 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
----------------------

View File

@ -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);
}
/**