Review 14.3 Merged

95628[BUGFIX] Omit null attributes in media rendering

Garvin Hicking CR +2 V +2 Normal +98 −4 updated 09/04/26, 07:50

Commit message

The media file renderers merge the values of the option
"additionalAttributes" into the tag attributes without looking at
their type. A null value therefore ends up as name="", and in
VimeoRenderer and YouTubeRenderer it reaches htmlspecialchars(),
which raises a deprecation notice and turns into a TypeError with
PHP 9.

The four renderers now follow the same rules as the TagBuilder of
Fluid: null and false omit the attribute, true renders a boolean
attribute and an empty string is kept as name="".

Keeping empty strings matters, as muted="" and muted are
equivalent in HTML and dropping them would change the meaning of
the markup. As a side effect an attribute can now be left out
conditionally, which resolves the original request.

Review

  • Code review CR +2 Done
    • Garvin Hicking +2
  • Verified V +2 Done
    • Garvin Hicking +2
    • core-ci +1 CI

Issues 2

Files 9

Review log 46

  1. Garvin Hicking commented on patch set 1 09/04/26, 06:48

    Cherry Picked from branch main.
  2. Garvin Hicking commented on patch set 2 09/04/26, 06:49

    Cherry Picked from branch main.
  3. core-ci voted on patch set 1 V -1 09/04/26, 07:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107811

  4. core-ci voted on patch set 2 V +1 09/04/26, 07:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/107813

  5. Garvin Hicking voted on patch set 2 CR +2 V +2 09/04/26, 07:50

  6. Garvin Hicking merged patch set 3 09/04/26, 07:50