Skip to content

Commit 0cf8f6a

Browse files
authored
Merge pull request #448 from w3c/krr
more restriction on entity expansion
2 parents cbd3400 + 7e50b9b commit 0cf8f6a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

org/w3c/css/css/XMLStyleSheetHandler.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,9 @@ void parse(String urlString, URLConnection connection) throws Exception {
549549

550550
xmlParser.setFeature("http://xml.org/sax/features/validation",
551551
false);
552+
xmlParser.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
553+
xmlParser.setFeature("http://xml.org/sax/features/external-general-entities", false);
554+
552555
xmlParser.setErrorHandler(this);
553556
xmlParser.setEntityResolver(this);
554557
} catch (Exception ex) {
@@ -605,6 +608,8 @@ public void parse(InputSource source, String fileName) throws IOException, SAXEx
605608
this);
606609
xmlParser.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
607610
xmlParser.setFeature("http://xml.org/sax/features/validation", false);
611+
xmlParser.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
612+
xmlParser.setFeature("http://xml.org/sax/features/external-general-entities", false);
608613
} catch (Exception ex) {
609614
ex.printStackTrace();
610615
}

0 commit comments

Comments
 (0)