heythm commented on code in PR #962:
URL: https://github.com/apache/solr/pull/962#discussion_r951327744
##########
solr/core/src/java/org/apache/solr/handler/component/QueryElevationComponent.java:
##########
@@ -376,10 +377,12 @@ protected long getConfigVersion(SolrCore core) {
*
* @return The loaded {@link ElevationProvider}; not null.
*/
- private ElevationProvider loadElevationProvider(SolrCore core) throws
Exception {
- XmlConfigFile cfg;
+ private ElevationProvider loadElevationProvider(SolrCore core) throws
IOException, SAXException {
+ InputStream inputStream = null;
+ Document xmlDocument;
try {
- cfg = new XmlConfigFile(core.getResourceLoader(), configFileName);
+ inputStream = core.getResourceLoader().openResource(configFileName);
+ xmlDocument = SafeXMLParsing.parseUntrustedXML(log, inputStream);
Review Comment:
- About modifying XmlConfigFile with `SafeXMLParsing#parseConfigXML`; It is
indeed possible to apply these changes. However, in `XmlConfigFile`, we
authorize the non-availability of SystemId so as not to activate xinclude for
this purpose. Unlike `SafeXMLParsing#parseConfigXML` where we enable it by
default. And, XmlConfigFile is used for reading Solr config files (see
`SolrConfig#readXml`). would that have some impact?
- `SafeXMLParsing#parseConfigXML` enables xinclude by default, whereas
`SafeXMLParsing#parseUntrustedXML` doesn't. It doesn't seem very "safe", is it?
I think if we don't need to activate it if we don't have to.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]