• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OWASP / java-html-sanitizer
93%
master: 94%

Build:
Build:
LAST BUILD BRANCH: 5372c747173f312b9342fac2ea6bc7445d3abeee
DEFAULT BRANCH: master
Repo Added 19 Mar 2019 08:07PM UTC
Files 44
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH 5372c747173f312b9342fac2ea6bc7445d3abeee
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • 5372c747173f312b9342fac2ea6bc7445d3abeee
  • OBRAZKI-1029
  • dependabot/maven/parent/com.google.guava-guava-29.0-jre
  • dependabot/maven/parent/junit-junit-4.13.1
  • main
  • master
  • mikesamuel-patch-1
  • obscure-named-char-refs-need-semis
  • release-20190325.1
  • release-20190503.1
  • release-20190610.1
  • release-20191001.1
  • release-20200615.1
  • release-20200713.1
  • sgjg-non-character-handling
  • svg-mathml-mixed-case-names

08 Jun 2022 04:43PM UTC coverage: 92.78%. First build
#133

push

web-flow
Decode attribute content differently from text node content (#255)

As described in issue #254 `&para` is a full complete character
reference when decoding text node content, but not when
decoding attribute content which causes problems for URL attribute
values like

    /test?param1=foo&param2=bar

As shown via JS test code in that issue, a small set of
next characters prevent a character reference name match
from being considered complete.

This commit:
- modifies the decode functions to take an extra parameter
  `boolean inAttribute`, and modifies the Trie traversal
  loops to not store a longest match so far based on that
  parameter and some next character tests
- modifies the HTML lexer to pass that attribute appropriately
- for backwards compat, leaves the old APIs in place but `@deprecated`
- adds unit tests for the decode functions
- adds a unit test for the specific input from the issue

This change should make us more conformant with observed
browser behaviour so is not expected to cause compatibility
problems for existing users.

Fixes #254

14 of 16 new or added lines in 3 files covered. (87.5%)

3945 of 4252 relevant lines covered (92.78%)

0.93 hits per line

Relevant lines Covered
Build:
Build:
4252 RELEVANT LINES 3945 COVERED LINES
0.93 HITS PER LINE
Source Files on master
  • Tree
  • List 44
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
#133 5372c747173f312b9342fac2ea6bc7445d3abeee Decode attribute content differently from text node content (#255) As described in issue #254 `&para` is a full complete character reference when decoding text node content, but not when decoding attribute content which causes problems for URL ... push 16 Apr 2026 05:44PM UTC web-flow
92.78
323 main Upgrade to a modern guava dependency This may still be overridden with `-Dguava-version=...`. push 13 May 2021 04:26PM UTC mikesamuel travis-ci pending completion  
322 dependabot/maven/parent/com.google.guava-guava-29.0-jre Merge 925230be7 into 020d5d0d7 Pull #227 31 Mar 2021 08:55PM UTC web-flow travis-ci pending completion  
321 dependabot/maven/parent/com.google.guava-guava-29.0-jre Bump guava from 27.1-jre to 29.0-jre in /parent Bumps [guava](https://github.com/google/guava) from 27.1-jre to 29.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) Signed-off... push 31 Mar 2021 08:52PM UTC web-flow travis-ci pending completion  
2 master <a href="https://github.com/OWASP/java-html-sanitizer/commit/c84daa12f">&lt;a href=&quot;https://github.com/OWASP/java-html-sanitizer/commit/</a><a class="double-link" href="https://github.com/OWASP/java-html-sanitiz... Pull #1 10 Feb 2021 03:40PM UTC web-flow travis-ci-com pending completion  
1 dependabot/maven/parent/junit-junit-4.13.1 Bump junit from 4.12 to 4.13.1 in /parent Bumps [junit](https://github.com/junit-team/junit4) from 4.12 to 4.13.1. - [Release notes](https://github.com/junit-team/junit4/releases) - [Changelog](https://github.com/junit-team/junit4/blob/main/doc/R... push 10 Feb 2021 03:38PM UTC web-flow travis-ci-com pending completion  
#127 sgjg-non-character-handling Additional usage of guava 27.1-jre replaced with 30.1-jre push 08 Feb 2021 12:04AM UTC Simon Greatrix pending completion  
320 sgjg-non-character-handling Merge d78fc8a56 into 020d5d0d7 Pull #225 08 Feb 2021 12:01AM UTC web-flow travis-ci pending completion  
319 sgjg-non-character-handling Merge 121c6c062 into 020d5d0d7 Pull #225 07 Feb 2021 11:56PM UTC web-flow travis-ci pending completion  
318 sgjg-non-character-handling Merge 594cc4d84 into 020d5d0d7 Pull #225 07 Feb 2021 11:45PM UTC web-flow travis-ci pending completion  
See All Builds (133)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc