Review main Merged

93051[BUGFIX] Handle non-string keys in implodeAttributes

Eric Harrer CR +2 V +2 Easy +7 −1 updated 03/04/26, 09:11

Commit message

Cast attribute keys to string before normalizing case in
GeneralUtility::implodeAttributes().

Malformed attribute lists can contain integer array keys (for example
from broken ATagParams parsing with unescaped quotes and numeric
tokens), which previously caused a TypeError in strtolower().

Valid string attribute keys keep their existing behavior. Non-string
keys are normalized to string instead of causing a fatal error.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Georg Ringer +1
    • Oliver Klee +1
    • Simon Praetorius +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Georg Ringer +1
    • Oliver Klee +1
    • Simon Praetorius +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 1213

  1. Eric Harrer uploaded patch set 1 03/03/26, 22:47

  2. core-ci voted on patch set 1 V +1 03/03/26, 22:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/97233

  3. Garvin Hicking commented on patch set 1 03/04/26, 05:53

    Hm. HTML specs say that a "only numbers" attribute is not allowed. So I wonder if its actually ok to throw an error on these attributes. Wdyt?
  4. Georg Ringer commented on patch set 1 03/04/26, 06:17

    thinkinkg about data attributes, numbers are fine there
  5. Georg Ringer voted on patch set 1 CR +1 V +1 03/04/26, 06:17

  6. Garvin Hicking commented on patch set 1 03/04/26, 06:50

    Reply

    Its about attributes. "Data-123" is nkt affe ted by the bug. An attribute 123="456" is invalid.
  7. Simon Praetorius voted on patch set 1 CR +1 V +1 03/04/26, 07:23

  8. Georg Ringer commented on patch set 1 03/04/26, 07:56

    sry garvin, true
  9. Oliver Klee voted on patch set 1 CR +1 V +1 03/04/26, 08:07

  10. Simon Praetorius commented on patch set 1 03/04/26, 08:13

    imho: I don‘t think an exception makes sense in such a low-level function. It the input generates invalid markup, this needs to be dealt with on a higher level
  11. Christian Kuhn commented on patch set 1 CR +1 V +1 03/04/26, 08:56

    agreed: this cast makes sense for this low level method.
  12. Christian Kuhn voted on patch set 1 CR +2 V +2 03/04/26, 08:57

  13. Christian Kuhn merged patch set 2 03/04/26, 09:11