Skip to content

Commit

Permalink
OPENNLP-1305: Disable DTD loading. (#376)
Browse files Browse the repository at this point in the history
  • Loading branch information
jzonthemtn committed Jun 2, 2020
1 parent bc13b3d commit e4b331d
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ static LetsmtDocument parse(InputStream letsmtXmlIn) throws IOException {
XMLReader xmlReader = saxParser.getXMLReader();
LetsmtDocumentHandler docHandler = new LetsmtDocumentHandler();
xmlReader.setContentHandler(docHandler);
xmlReader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
xmlReader.parse(new InputSource(letsmtXmlIn));
return new LetsmtDocument(docHandler.sentences);
} catch (SAXException e) {
Expand Down

0 comments on commit e4b331d

Please sign in to comment.