Issue Bug Closed

#102044The ContentObjectRenderer needs to catch \Throwable insteadof \Exception

Philipp Wrann 09/27/23, 08:28 updated 07/09/24, 15:19

Description

The ContentObjectRenderer is not capable of dealing with \Throwable errors, that do not extend \Exception. A common Error that will “fall through” is a ValueError that is thrown by some php function. For example the sprintf function, which is used by the Translation utilities might throw a ValueError if the translation string contains an invalid formatter. This can happen when a translator leaves a literal “%” character in xliff strings.

This could be fixed by changing the catch argument here from \Exception to \Throwable.
https://github.com/TYPO3/typo3/blob/main/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php#L670

In my case a typo3 V11 installation is affected. The bugfix is so small and will not break any system with a minimum requirement of php 7+. So i would argue for backports to V12 and V11 as well.

Reviews 3

History 27

  1. Gerrit Code Review pushed patch set 1 for main to change 81573 status New Under Review 10/25/23, 20:02

  2. Gerrit Code Review pushed patch set 2 for main to change 81573 10/26/23, 06:43

  3. Gerrit Code Review pushed patch set 3 for main to change 81573 10/26/23, 19:09

  4. Gerrit Code Review pushed patch set 1 for 12.4 to change 84756 06/19/24, 21:06

  5. Gerrit Code Review pushed patch set 1 for 11.5 to change 84757 06/19/24, 21:06

  6. Sascha Egerer commented and changed status Under Review Resolved done 0 % 100 % 06/19/24, 21:10

    Applied in changeset commit:9819ed85807fb3804be4d9c559a8b16b3970435d.

  7. Benni Mack changed status Resolved Closed 07/09/24, 15:19