Skip to content
Permalink
Browse files
Disable external DTD/schema access
  • Loading branch information
coheigea committed Oct 24, 2019
1 parent 7a6cd62 commit f0c0968b9cea090c9e44bd0f01aef9665c53a4d5
Showing 1 changed file with 9 additions and 0 deletions.
@@ -316,6 +316,15 @@ public static Document styleDocument( Document document )
try
{
factory.setFeature( javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING, Boolean.TRUE );
try
{
factory.setAttribute( javax.xml.XMLConstants.ACCESS_EXTERNAL_DTD, "" );
factory.setAttribute( javax.xml.XMLConstants.ACCESS_EXTERNAL_STYLESHEET, "" );
}
catch ( IllegalArgumentException ex )
{
// ignore
}
transformer = factory.newTransformer( new StreamSource( ParserUtils.class
.getResourceAsStream( "/org/apache/directory/shared/dsmlv2/DSMLv2.xslt" ) ) );
}

0 comments on commit f0c0968

Please sign in to comment.