Review main Merged

73052[BUGFIX] Avoid calling trim(null) in ContentObjectRenderer

TYPO3com CR +2 V +2 Easy +1 −1 updated 01/19/22, 13:57

Commit message

'ContentObjectRenderer->stdWrap()' calls subfunction starting
with 'stdWrap_' which may not only return strings, but also int,
boolean, null and so on, thus eventually feeding 'trim()' with
null or a non string value to which emits a PHP8.0 warning and
an type error on PHP8.1.

To mitigate this string cast is added on the value for the
'trim(...)' call to be close to the spot and do not change
behaviour for now.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Oliver Klee +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1115

  1. TYPO3com uploaded patch set 1 01/18/22, 00:06

  2. core-ci voted on patch set 1 V +1 01/18/22, 00:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22207

  3. Stefan Bürk commented on patch set 1 01/18/22, 07:46

    Typo, should be [BUGFIX]

    ContentObjectRenderer.php:1254

    My first thought was, that his is superflous because $content is type casted in L1207. Instead of adding the typecast here, we schould add this to cast the returns in L1279 - or better check all possible methods to return alwas a string.
  4. Stefan Bürk uploaded patch set 2 01/18/22, 23:10

  5. Stefan Bürk commented on patch set 2 V +1 CR +1 01/18/22, 23:11

    Reply

    Done

    ContentObjectRenderer.php:1254 Reply

    Done
  6. core-ci voted on patch set 2 V +1 01/18/22, 23:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22238

  7. Oliver Klee voted on patch set 2 CR +1 01/18/22, 23:40

  8. Christian Kuhn commented on patch set 2 CR -1 01/19/22, 00:38

    ContentObjectRenderer.php:1254

    i'd prefer to have the string cast here (near the sink), not in line 1279 - just to make sure this is side effect free.
  9. Stefan Bürk uploaded patch set 3 01/19/22, 13:12

  10. Stefan Bürk commented on patch set 3 01/19/22, 13:13

    ContentObjectRenderer.php:1254 Reply

    Done
  11. Oliver Klee voted on patch set 3 CR +1 01/19/22, 13:15

  12. core-ci voted on patch set 3 V +1 01/19/22, 13:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22266

  13. Stefan Bürk voted on patch set 3 V +1 CR +1 01/19/22, 13:22

  14. Christian Kuhn voted on patch set 3 V +2 CR +2 01/19/22, 13:57

  15. Christian Kuhn merged patch set 4 01/19/22, 13:57