Skip to content

Commit

Permalink
[TASK] Remove unused code related to config.locale_all
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bmack authored and andreaskienast committed Apr 2, 2020
1 parent b61743f commit 0d6f046
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions typo3/sysext/core/Classes/Utility/GeneralUtility.php
Expand Up @@ -790,16 +790,8 @@ public static function formatSize($sizeInBytes, $labels = '', $base = 0)
}
$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;
Expand Down

0 comments on commit 0d6f046

Please sign in to comment.