Skip to content

Commit

Permalink
Issue #7468: disable 'external-parameter-entities' feature by default
Browse files Browse the repository at this point in the history
  • Loading branch information
romani authored and pbludov committed Jan 20, 2020
1 parent dfed794 commit c46a16d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/puppycrawl/tools/checkstyle/XmlLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ public static final class LoadExternalDtdFeatureProvider {
/** Feature that enables including external general entities in XML files. */
public static final String EXTERNAL_GENERAL_ENTITIES =
"http://xml.org/sax/features/external-general-entities";
/** Feature that enables including external parameter entities in XML files. */
public static final String EXTERNAL_PARAMETER_ENTITIES =
"http://xml.org/sax/features/external-parameter-entities";

/** Stop instances being created. **/
private LoadExternalDtdFeatureProvider() {
Expand All @@ -146,6 +149,7 @@ public static void setFeaturesBySystemProperty(SAXParserFactory factory)

factory.setFeature(LOAD_EXTERNAL_DTD, enableExternalDtdLoad);
factory.setFeature(EXTERNAL_GENERAL_ENTITIES, enableExternalDtdLoad);
factory.setFeature(EXTERNAL_PARAMETER_ENTITIES, enableExternalDtdLoad);
}

}
Expand Down

0 comments on commit c46a16d

Please sign in to comment.