Skip to content

Commit 710a919

Browse files
Don't completely disable DTD parsing
1 parent 28c0b75 commit 710a919

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/loci/common/xml/XMLTools.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,6 @@ private static TransformerFactory createTransformFactory() {
125125
private static Map<String, Boolean> createXMLParserFeatures() {
126126
HashMap<String, Boolean> features = new HashMap<String, Boolean>();
127127
features.put(XMLConstants.FEATURE_SECURE_PROCESSING, true);
128-
features.put("http://apache.org/xml/features/disallow-doctype-decl", true);
129128
features.put("http://xml.org/sax/features/external-general-entities", false);
130129
features.put("http://xml.org/sax/features/external-parameter-entities", false);
131130
features.put("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
@@ -175,6 +174,7 @@ public static DocumentBuilder createBuilder() {
175174
try {
176175
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
177176
factory.setXIncludeAware(false);
177+
factory.setExpandEntityReferences(false);
178178
for (String feature : FEATURES.keySet()) {
179179
try {
180180
factory.setFeature(feature, FEATURES.get(feature));

0 commit comments

Comments
 (0)