Project

General

Profile

Actions

Bug #102044

open

The ContentObjectRenderer needs to catch \Throwable insteadof \Exception

Added by Philipp Wrann 7 months ago. Updated 7 months ago.

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

0%

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 #1

Updated by Gerrit Code Review 7 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81573

Actions #2

Updated by Gerrit Code Review 7 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81573

Actions #3

Updated by Gerrit Code Review 7 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/81573

Actions

Also available in: Atom PDF