Skip to content

Commit e4b331d

Browse files
authored
OPENNLP-1305: Disable DTD loading. (#376)
1 parent bc13b3d commit e4b331d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

opennlp-tools/src/main/java/opennlp/tools/formats/letsmt/LetsmtDocument.java

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ static LetsmtDocument parse(InputStream letsmtXmlIn) throws IOException {
124124
XMLReader xmlReader = saxParser.getXMLReader();
125125
LetsmtDocumentHandler docHandler = new LetsmtDocumentHandler();
126126
xmlReader.setContentHandler(docHandler);
127+
xmlReader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
127128
xmlReader.parse(new InputSource(letsmtXmlIn));
128129
return new LetsmtDocument(docHandler.sentences);
129130
} catch (SAXException e) {

0 commit comments

Comments
 (0)