uschindler commented on code in PR #962:
URL: https://github.com/apache/solr/pull/962#discussion_r951543778
##########
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:
Of course if the elevate.xml is coming over the network as part of the
request, then it should be parsed with untrusted.
I am not familar with the code, but the rule for config files is:
- if the config file is XML in ResourceLoader, it should use
SafeXMLParsing#parseConfigXML with xinclude enabled for consistency
- if the elevation file is passed as part of request body, then parse it
using the request input stream using SafeXMLParsing#parseUntrustedXML
I'd tune XmlConfigFile to use those APIs. Back at that time it was too much
work to me, so I left that one out. I just added the SystemIdResolver.
--
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]