From cd446e5d05aebaf3cd9d685c06f89bc8b8ad4b4d Mon Sep 17 00:00:00 2001 From: Hans Van Akelyen Date: Tue, 12 Nov 2024 09:47:46 +0100 Subject: [PATCH] fix user option form XML_DOCTYPE, #2744 --- .../org/apache/hop/core/xml/XmlParserFactoryProducer.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/apache/hop/core/xml/XmlParserFactoryProducer.java b/core/src/main/java/org/apache/hop/core/xml/XmlParserFactoryProducer.java index ef64d9fadf..6852ca2576 100644 --- a/core/src/main/java/org/apache/hop/core/xml/XmlParserFactoryProducer.java +++ b/core/src/main/java/org/apache/hop/core/xml/XmlParserFactoryProducer.java @@ -22,6 +22,7 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParserFactory; import org.apache.hop.core.Const; +import org.apache.hop.core.util.EnvUtil; import org.xml.sax.SAXNotRecognizedException; import org.xml.sax.SAXNotSupportedException; @@ -37,13 +38,14 @@ private XmlParserFactoryProducer() { * * @throws ParserConfigurationException if feature can't be enabled */ + @SuppressWarnings("java:S2755") public static DocumentBuilderFactory createSecureDocBuilderFactory() throws ParserConfigurationException { DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance(); docBuilderFactory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); docBuilderFactory.setFeature( "http://apache.org/xml/features/disallow-doctype-decl", - "N".equals(Const.XML_ALLOW_DOCTYPE_DECL)); + "N".equals(EnvUtil.getSystemProperty(Const.XML_ALLOW_DOCTYPE_DECL))); return docBuilderFactory; }