81325[BUGFIX] Mitigate locale `C` in `DateFormatter` wrapping class
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Oli Bartsch +1
- Oliver Klee +1
- Markus Klein +1
- Simon Schaufelberger +1
-
Verified V +2 Done
- Stefan Bürk +2
- Oli Bartsch +1
- Oliver Klee +1
- Markus Klein +1
- Simon Schaufelberger +1
- core-ci +1 CI
Issues 1
Files 2
Review log 1720
-
Stefan Bürk uploaded patch set 1 10/05/23, 11:04
-
core-ci voted on patch set 1 V -1 10/05/23, 11:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47436
-
Oliver Klee commented on patch set 1 10/05/23, 11:40
DateFormatter.php:108I propose we make this more explicit (mostly for the benefit of the human reader): ```php if (is_string($locale)) { ``` -
Stefan Bürk uploaded patch set 2
V -110/05/23, 12:06 -
Stefan Bürk commented on patch set 2 10/05/23, 12:07
DateFormatter.php:107Replyirrelevant - if condition has been removed again.DateFormatter.php:108Replyirrelevant - if condition has been removed again. -
Stefan Bürk commented on patch set 2 10/05/23, 12:07
DateFormatter.php:107ReplyDone -
Oliver Klee commented on patch set 2 10/05/23, 12:11
DateFormatter.php:89According to https://www.php.net/manual/de/function.setlocale.php, `setlocale` will return `false` if there is a problem. In this case (`false`, which gets cast to an empty string), I suggest we also switch to the `en-US` fallback locale.DateFormatterTest.php:94I propose we also have a test with a nonsensical locale (i.e., that is certain to not exist), e.g., `inexistent-locale` (which would this very explicit to the reader). -
core-ci voted on patch set 2 V +1 10/05/23, 12:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47439
-
Stefan Bürk commented on patch set 2 10/05/23, 12:21
DateFormatter.php:89Replyempty locale would let the IntlFormatter fallback to the default php ini setting for intl.locale ... therefore, the empty is okay here. `C` is adopted to fallback like it is handled in the Locale() class implementation already. Mainly, because `ext:intl` does not take C as a valid locale. A general handling of this and other cases needs to be addressed in a bigger picture. This change is about getting a first working state so we can update the PHP8.3.0 image to RC3 for now. I would not switch to a overall default of 'en-US' for all cases.DateFormatterTest.php:94ReplyWe should taggle that in a dedicated patch. The locale handling needs additional work, and the setlocale() needs to vanish in either cases. The goal of this change is to get a compatible state for PHP8.3 right now. Handling of absolutly not existing/invalid locales needs to be addressed in a bigger picture. -
Oliver Klee commented on patch set 2 V +1 CR +1 10/05/23, 12:34
DateFormatterTest.php:94ReplyAck -
Markus Klein updated the commit message in patch set 3
CR +1V +110/05/23, 12:55 -
Markus Klein voted on patch set 3 V +1 CR +1 10/05/23, 12:55
-
core-ci voted on patch set 3 V +1 10/05/23, 13:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47440
-
Stefan Bürk voted on patch set 3 V +2 CR +2 10/05/23, 13:21
-
Stefan Bürk voted on patch set 3 V 0 CR 0 10/05/23, 13:21
-
Oliver Klee voted on patch set 3 V +1 CR +1 10/05/23, 13:51
-
Simon Schaufelberger voted on patch set 3 V +1 CR +1 10/05/23, 14:23
-
Oli Bartsch voted on patch set 3 V +1 CR +1 10/05/23, 14:46
-
Stefan Bürk voted on patch set 3 V +2 CR +2 10/05/23, 14:47
-
Stefan Bürk merged patch set 4 10/05/23, 14:56
DateFormatter.php:107