Skip to content

Commit

Permalink
Merge pull request #1392 from reportportal/sax-parser-fix
Browse files Browse the repository at this point in the history
EPMRPP-62610 || Sax parser fix
  • Loading branch information
pbortnik committed Jun 2, 2021
2 parents d5152d8 + 974a2b2 commit a73e0df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: true

before_install:
- sudo apt-get install -y fonts-noto
script: ./gradlew buildDocker --full-stacktrace --no-build-cache
script: ./gradlew build --full-stacktrace --no-build-cache

env:
global:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,18 @@ public ParseResults call() {
// Xerces 1 - http://xerces.apache.org/xerces-j/features.html#external-general-entities
// Xerces 2 - http://xerces.apache.org/xerces2-j/features.html#external-general-entities

// Xerces 2 only - http://xerces.apache.org/xerces-j/features.html#external-general-entities
spf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
// Using the SAXParserFactory's setFeature
spf.setFeature("http://xml.org/sax/features/external-general-entities", false);
spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
spf.setXIncludeAware(false);
// Using the XMLReader's setFeature
reader.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
reader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
reader.setFeature("http://xml.org/sax/features/external-general-entities", false);

// Xerces 2 only - http://xerces.apache.org/xerces-j/features.html#external-general-entities
spf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true);
reader.setFeature("http://xml.org/sax/features/external-parameter-entities", false);

saxParser.parse(xmlInputStream, handler);
} catch (SAXException | IOException | ParserConfigurationException e) {
Expand Down

0 comments on commit a73e0df

Please sign in to comment.