Skip to content

Commit

Permalink
fix LOGBACK-1465
Browse files Browse the repository at this point in the history
Signed-off-by: Ceki Gulcu <ceki@qos.ch>
  • Loading branch information
ceki committed Sep 9, 2021
1 parent db1a652 commit e30dc08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -78,6 +78,9 @@ private SAXParser buildSaxParser() throws JoranException {
try {
SAXParserFactory spf = SAXParserFactory.newInstance();
spf.setValidating(false);
//spf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
spf.setFeature("http://xml.org/sax/features/external-general-entities", false);
spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
spf.setNamespaceAware(true);
return spf.newSAXParser();
} catch (Exception pce) {
Expand Down
Expand Up @@ -183,7 +183,8 @@ String copyToTemp(String in) throws IOException {

@Test
public void malformedURL() throws JoranException {
System.setProperty(INCLUDE_KEY, "htp://logback.qos.ch");
String MALFORMED = "htp://logback.qos.ch";
System.setProperty(INCLUDE_KEY, MALFORMED);
tc.doConfigure(TOP_BY_URL);
assertEquals(Status.ERROR, statusChecker.getHighestLevel(0));
assertTrue(statusChecker.containsException(MalformedURLException.class));
Expand Down Expand Up @@ -219,7 +220,10 @@ public void multiInclude() throws JoranException {
@Test
public void includeAsEntity() throws JoranException {
tc.doConfigure(TOP_BY_ENTITY);
verifyConfig(new String[] { "EA", "EB" });

// entity inclusion disabled
// verifyConfig(new String[] { "EA", "EB" });
verifyConfig(new String[] { });
}

void verifyConfig(String[] expected) {
Expand Down

0 comments on commit e30dc08

Please sign in to comment.