Review main Merged

81704[BUGFIX] Prevent possible PHP crash with empty systemLocale

Xavier Perseguers CR +2 V +2 Easy +4 −2 updated 11/07/23, 16:19

Commit message

When $GLOBALS['TYPO3_CONF_VARS']['SYS']['systemLocale'] is empty, a call
to setlocale() may lead to a PHP crash.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
  • Verified V +2 Done
    • Benni Mack +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1012

  1. Xavier Perseguers uploaded patch set 1 11/07/23, 14:58

  2. Benni Mack commented on patch set 1 CR +1 11/07/23, 15:05

    looks good
  3. core-ci voted on patch set 1 V +1 11/07/23, 15:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48692

  4. Benni Mack commented on patch set 1 11/07/23, 15:06

    CommandUtility.php:447

    I think we need the $currentLocale assignment into the if as well
  5. Xavier Perseguers commented on patch set 1 11/07/23, 15:23

    CommandUtility.php:447 Reply

    No, as the $currentLocale call cannot fail with argument '0' which doesn't set anything but return current configuration and it's used afterwards to "reset" the locale to the one defined globally.
  6. Xavier Perseguers commented on patch set 1 11/07/23, 15:24

    CommandUtility.php:447 Reply

    ah, I see what you mean, but this should do any harm anyway.
  7. Xavier Perseguers uploaded patch set 2 CR +1 V +1 11/07/23, 15:25

  8. Xavier Perseguers commented on patch set 2 11/07/23, 15:26

    this way we don't take any risk "breaking" something.

    CommandUtility.php:447 Reply

    Done
  9. core-ci voted on patch set 2 V +1 11/07/23, 15:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48693

  10. Garvin Hicking commented on patch set 2 V +1 CR +1 11/07/23, 16:16

    Nice catch! :-)
  11. Benni Mack voted on patch set 2 V +2 CR +2 11/07/23, 16:19

  12. Benni Mack merged patch set 3 11/07/23, 16:19