From 0d6f0460798048aa22ebaf57a254ad22d52a9d88 Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Wed, 1 Apr 2020 21:30:25 +0200
Subject: [PATCH] [TASK] Remove unused code related to config.locale_all

In TYPO3 v10 locale is set very early in due to the availability of the Site Language,
making the whole set up working properly without having to evaluate
config.locale_all TypoScript.

This code can now safely be removed.

Resolves: #82491
Releases: master
Change-Id: I9df3ec2d2e111e0ec035971fe42efcc280ac6afd
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/64045
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Josef Glatz <josefglatz@gmail.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Josef Glatz <josefglatz@gmail.com>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
---
 typo3/sysext/core/Classes/Utility/GeneralUtility.php | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/typo3/sysext/core/Classes/Utility/GeneralUtility.php b/typo3/sysext/core/Classes/Utility/GeneralUtility.php
index 4d8041446e74..d366510965bd 100644
--- a/typo3/sysext/core/Classes/Utility/GeneralUtility.php
+++ b/typo3/sysext/core/Classes/Utility/GeneralUtility.php
@@ -790,16 +790,8 @@ class GeneralUtility
             }
             $labelArr = explode('|', str_replace('"', '', $labels));
         }
-        // @todo find out which locale is used for current BE user to cover the BE case as well
-        $oldLocale = setlocale(LC_NUMERIC, 0);
-        $newLocale = $GLOBALS['TSFE']->config['config']['locale_all'] ?? '';
-        if ($newLocale) {
-            setlocale(LC_NUMERIC, $newLocale);
-        }
+        // This is set via Site Handling and in the Locales class via setlocale()
         $localeInfo = localeconv();
-        if ($newLocale) {
-            setlocale(LC_NUMERIC, $oldLocale);
-        }
         $sizeInBytes = max($sizeInBytes, 0);
         $multiplier = floor(($sizeInBytes ? log($sizeInBytes) : 0) / log($base));
         $sizeInUnits = $sizeInBytes / $base ** $multiplier;
-- 
GitLab