[BUGFIX] config.locale_all should format floating point values 55/47455/3
authorXavier Perseguers <xavier@typo3.org>
Thu, 31 Mar 2016 09:20:08 +0000 (11:20 +0200)
committerBenni Mack <benni@typo3.org>
Thu, 31 Mar 2016 11:18:36 +0000 (13:18 +0200)
The bug with LC_NUMERIC existed in PHP 4.2.3 but is fixed since at least
PHP 5.1.6. The patch uses LC_ALL now.

Change-Id: I08c1600b05ad858d67d2a2e23fd3c0332000527d
Releases: master, 7.6
Resolves: #75141
Reviewed-on: https://review.typo3.org/47455
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 0b2f99d..fa38983 100644 (file)
@@ -2732,15 +2732,8 @@ class TypoScriptFrontendController
     {
         // Setting locale
         if ($this->config['config']['locale_all']) {
-            // There's a problem that PHP parses float values in scripts wrong if the
-            // locale LC_NUMERIC is set to something with a comma as decimal point
-            // Do we set all except LC_NUMERIC
-            $locale = setlocale(LC_COLLATE, $this->config['config']['locale_all']);
-            if ($locale) {
-                setlocale(LC_CTYPE, $this->config['config']['locale_all']);
-                setlocale(LC_MONETARY, $this->config['config']['locale_all']);
-                setlocale(LC_TIME, $this->config['config']['locale_all']);
-            } else {
+            $locale = setlocale(LC_ALL, $this->config['config']['locale_all']);
+            if (!$locale) {
                 $this->getTimeTracker()->setTSlogMessage('Locale "' . htmlspecialchars($this->config['config']['locale_all']) . '" not found.', 3);
             }
         }