Review main Ready for review Quiet

96429[BUGFIX] Decode single quote entity in tag attributes

Georg Ringer CR +1 V +1 Normal +146 −2 updated 10/19/26, 14:56

Commit message

HtmlParser::get_tag_attributes() and
GeneralUtility::get_tag_attributes() decode attribute values with
htmlspecialchars_decode() and its default flags. These include
ENT_HTML401, which does not know the named entity "'".

Attribute values containing "'", e.g. written by the HTML
sanitizer when "security.backend.htmlSanitizeRte" is enabled, are
therefore not decoded and get double encoded to "'" when
the attributes are imploded again. This happens both when loading
content into the RTE and when rendering links via parseFunc in the
frontend.

Both methods now decode with ENT_QUOTES | ENT_HTML5. Since
htmlspecialchars_decode() only handles the special characters, no
other named entities are decoded.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 2
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/29/96429/2 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/29/96429/2 && git cherry-pick FETCH_HEAD

Review

  • Code review CR +1 Needs a vote
    • Simon Schaufelberger +1
  • Verified V +1 Needs a vote
    • Simon Schaufelberger +1
    • core-ci +1 CI

Merge conflicts 3

Issues 1

Files 6

Review log 68

  1. Georg Ringer uploaded patch set 1 10/06/26, 18:30

  2. Georg Ringer commented on patch set 1 10/06/26, 18:30

    This change is ready for review.
  3. core-ci voted on patch set 1 V +1 10/06/26, 18:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/110258

  4. Simon Schaufelberger voted on patch set 1 CR +1 V +1 10/09/26, 19:53

  5. Markus Klein voted on patch set 1 CR +1 V +1 10/12/26, 21:45

  6. Georg Ringer rebased onto patch set 2 CR +1 V +1 10/16/26, 18:03

  7. core-ci voted on patch set 2 V +1 10/16/26, 18:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/111389

  8. Simon Schaufelberger voted on patch set 2 CR +1 V +1 10/19/26, 14:56