Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Mitigate locale
C
in DateFormatter
wrapping class
Since PHP 8.3.0RC3 [1] the `\IntlDateFormatter` throws a `\IntlException` exception with the message: datefmt_create: invalid locale: U_ILLEGAL_ARGUMENT_ERROR if an invalid locale is passed to the constructor. The value `C` is considered as a non-valid locale, albeit it may be set. This change introduces a fallback to `en-US` for the two methods of the `\TYPO3\CMS\Core\Localization\DateFormatter` wrapping class, if `C` is passed as locale. `en-US` has been chosen as fallback because the TYPO3 locale class `\TYPO3\CMS\Core\Localization\Locale` uses the same as fallback if `C` is provided and additional tests are added to cover the same behaviour. Note: Other illegal locales are not handled and will allow the exception to bubble up with PHP8.3+. [1] php/php-src@a80db7b52aa134bdc8b9841 Resolves: #102095 Releases: main, 12.4 Change-Id: I26d1ab74bd9dd659363320e191874f8526845158 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/81335 Tested-by: Stefan Bürk <stefan@buerk.tech> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Stefan Bürk <stefan@buerk.tech>
- Loading branch information
Showing
2 changed files
with
51 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters