Project

General

Profile

Actions

Bug #102044

closed

The ContentObjectRenderer needs to catch \Throwable insteadof \Exception

Added by Philipp Wrann about 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Start date:
2023-09-27
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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.

Actions

Also available in: Atom PDF