Skip to content

Commit

Permalink
Disable external DTDs for SAXParserFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhihang Yao committed Jun 20, 2022
1 parent 1ab40b0 commit a82199a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ public static SAXParserFactory newSAXParserFactory() throws SAXNotSupportedExcep
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
factory.setFeature("http://xml.org/sax/features/external-general-entities", false);
factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
factory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);

return factory;
}

Expand Down

0 comments on commit a82199a

Please sign in to comment.