Skip to content

Commit

Permalink
Disable external entity processing
Browse files Browse the repository at this point in the history
  • Loading branch information
tzaeschke committed Feb 17, 2024
1 parent 71f1916 commit e8a67db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/src/main/java/javax/jdo/JDOHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ public static Object getVersion(Object pc) {
return IMPL_HELPER.nonBinaryCompatibleGet(pc, getVersion);
}
}

/**
* Tests whether the parameter instance is dirty.
*
Expand Down Expand Up @@ -1143,6 +1144,11 @@ protected static DocumentBuilderFactory getDocumentBuilderFactory() {

protected static DocumentBuilderFactory getDefaultDocumentBuilderFactory() {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
try {
factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
} catch (ParserConfigurationException e) {
throw new JDOFatalUserException(e.getMessage());
}
factory.setIgnoringComments(true);
factory.setNamespaceAware(true);
factory.setValidating(false);
Expand Down

0 comments on commit e8a67db

Please sign in to comment.