#8682: no result check for setlocale() via TypoScript
authorMartin Kutschker <martin.t.kutschker@blackbox.net>
Sun, 13 Jul 2008 13:39:03 +0000 (13:39 +0000)
committerMartin Kutschker <martin.t.kutschker@blackbox.net>
Sun, 13 Jul 2008 13:39:03 +0000 (13:39 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@3884 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
NEWS.txt
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/index_ts.php

index c44aa83..c4bef38 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 2008-07-13  Martin Kutschker  <masi@typo3.org>
 
        * Fixed bug #5476: links entered in <th>-tag with the RTE are not parsed on the frontend because parseFunc doesn't recognize <th> as cells (thanks to Daniel Ellermann)
+       * Fixed bug #8682: no result check for setlocale via TypoScript
 
 2008-07-12  Martin Kutschker  <masi@typo3.org>
 
index f50755d..8f99d5d 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -23,6 +23,11 @@ Speed improvements
 
        * ...
 
+Frontend
+==================
+
+       * The message log of the admin panel will report failures to set the locale
+
 Development
 ====================
 
index cd2e269..1940151 100755 (executable)
@@ -2337,12 +2337,16 @@ require_once (PATH_t3lib.'class.t3lib_lock.php');
                        #setlocale('LC_NUMERIC','en_US');
 
                        # so we set all except LC_NUMERIC
-                       setlocale(LC_COLLATE,$this->config['config']['locale_all']);
-                       setlocale(LC_CTYPE,$this->config['config']['locale_all']);
-                       setlocale(LC_MONETARY,$this->config['config']['locale_all']);
-                       setlocale(LC_TIME,$this->config['config']['locale_all']);
+                       $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']);
 
-                       $this->localeCharset = $this->csConvObj->get_locale_charset($this->config['config']['locale_all']);
+                               $this->localeCharset = $this->csConvObj->get_locale_charset($this->config['config']['locale_all']);
+                       } else {
+                               $GLOBALS['TT']->setTSlogMessage('Locale "'.htmlspecialchars($this->config['config']['locale_all']).'" not found.', 3);
+                       }
                }
        }
 
index ca457de..2c30531 100755 (executable)
@@ -395,8 +395,10 @@ $TSFE->convPOSTCharset();
 // *******************************************
 // Setting language and locale
 // *******************************************
-$TSFE->settingLanguage();
-$TSFE->settingLocale();
+$TT->push('Setting language and locale','');
+       $TSFE->settingLanguage();
+       $TSFE->settingLocale();
+$TT->pull();
 
 
 // ********************************