Revert "[TASK] Remove locale-workaround for PHP before 5.5" 70/49570/3
authorFrans Saris <franssaris@gmail.com>
Fri, 19 Aug 2016 13:20:10 +0000 (15:20 +0200)
committerFrans Saris <franssaris@gmail.com>
Thu, 25 Aug 2016 08:24:24 +0000 (10:24 +0200)
This reverts commit 23b588c584f485f10ae265bf30e15d231f428f1e.

The change is reverted as str_* methods are locale aware
and turkish has no upper case I. Class autoloading and other
checks depending on case changing break with turkish locale LC_CTYPE.

Change-Id: Ie4fb92411eeb2552972b92b3f2bcfdb47afcdd54
Resolves: #77551
Reverts: #63288
Releases: master,7.6
Reviewed-on: https://review.typo3.org/49570
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 350bda5..1d60b47 100644 (file)
@@ -2819,7 +2819,12 @@ class TypoScriptFrontendController
             // @see https://bugs.php.net/bug.php?id=53711
             $locale = setlocale(LC_COLLATE, $this->config['config']['locale_all']);
             if ($locale) {
-                setlocale(LC_CTYPE, $this->config['config']['locale_all']);
+                // As str_* methods are locale aware and turkish has no upper case I
+                // Class autoloading and other checks depending on case changing break with turkish locale LC_CTYPE
+                // @see http://bugs.php.net/bug.php?id=35050
+                if (substr($this->config['config']['locale_all'], 0, 2) != 'tr') {
+                    setlocale(LC_CTYPE, $this->config['config']['locale_all']);
+                }
                 setlocale(LC_MONETARY, $this->config['config']['locale_all']);
                 setlocale(LC_TIME, $this->config['config']['locale_all']);
                 $this->localeCharset = $this->csConvObj->get_locale_charset($this->config['config']['locale_all']);