Project

General

Profile

Actions

Task #102045

open

The LocalizationUtility should handle ValueError Exceptions thrown by sprintf

Added by Philipp Wrann 7 months ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Extbase
Start date:
2023-09-27
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
Sprint Focus:

Description

@see https://forge.typo3.org/issues/102044
@see https://www.php.net/manual/en/function.sprintf.php

Since PHP 8.0 sprintf throws ValueError Exceptions insteadof triggering a warning.

At the moment a ValueError is thrown and ultimately only catched by the RequestHandler, which results in a generic 500/503 Error page with a not so verbose error message (even in development).

It would be better, if the LocalizationUtility would catch ValueError Exceptions thrown by PHP, log them in a very verbose way (The translation string for the entity '{fullIdentifier}' is malformed: {originalValueError}). It should then also take alternativeLanguageKeys into account (as fallback) and finally return a blank string so fallback handling can kick in.

No data to display

Actions

Also available in: Atom PDF