[TASK] Small cleanup in Boostrap.php 39/19039/3
authorMichael Stucki <michael.stucki@typo3.org>
Tue, 19 Mar 2013 12:54:00 +0000 (13:54 +0100)
committerBenjamin Mack <benni@typo3.org>
Fri, 22 Mar 2013 17:38:31 +0000 (18:38 +0100)
Code cleanup prior to #41596

Releases: 6.1, 6.0
Change-Id: I87294a52e282175b345ee8b1a735604f6993e0f3
Reviewed-on: https://review.typo3.org/19039
Reviewed-by: Benjamin Mack
Tested-by: Benjamin Mack
typo3/sysext/core/Classes/Core/Bootstrap.php

index 879610c..86de885 100644 (file)
@@ -312,15 +312,32 @@ class Bootstrap {
                // Check if [BE][forceCharset] has been set in localconf.php
                if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'])) {
                        // die() unless we're already on UTF-8
-                       if ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] != 'utf-8' && $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] && TYPO3_enterInstallScript !== '1') {
-                               die('This installation was just upgraded to a new TYPO3 version. Since TYPO3 4.7, utf-8 is always enforced.<br />' . 'The configuration option $GLOBALS[\'TYPO3_CONF_VARS\'][BE][forceCharset] was marked as deprecated in TYPO3 4.5 and is now ignored.<br />' . 'You have configured the value to something different, which is not supported anymore.<br />' . 'Please proceed to the Update Wizard in the TYPO3 Install Tool to update your configuration.');
+                       if ($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] != 'utf-8' &&
+                               $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] &&
+                               TYPO3_enterInstallScript !== '1') {
+
+                               die('This installation was just upgraded to a new TYPO3 version. Since TYPO3 4.7, utf-8 is always enforced.<br />' .
+                                       'The configuration option $GLOBALS[\'TYPO3_CONF_VARS\'][BE][forceCharset] was marked as deprecated in TYPO3 4.5 and is now ignored.<br />' .
+                                       'You have configured the value to something different, which is not supported anymore.<br />' .
+                                       'Please proceed to the Update Wizard in the TYPO3 Install Tool to update your configuration.'
+                               );
                        } else {
                                unset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']);
                        }
                }
-               if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit']) && $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] !== '-1' && preg_match('/SET NAMES utf8/', $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit']) === FALSE && TYPO3_enterInstallScript !== '1') {
+
+               if (isset($GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit']) &&
+                       $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] !== '-1' &&
+                       preg_match('/SET NAMES utf8/', $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit']) === FALSE &&
+                       TYPO3_enterInstallScript !== '1') {
+
                        // Only accept "SET NAMES utf8" for this setting, otherwise die with a nice error
-                       die('This TYPO3 installation is using the $GLOBALS[\'TYPO3_CONF_VARS\'][\'SYS\'][\'setDBinit\'] property with the following value:' . chr(10) . $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] . chr(10) . chr(10) . 'It looks like UTF-8 is not used for this connection.' . chr(10) . chr(10) . 'Everything other than UTF-8 is unsupported since TYPO3 4.7.' . chr(10) . 'The DB, its connection and TYPO3 should be migrated to UTF-8 therefore. Please check your setup.');
+                       die('This TYPO3 installation is using the $GLOBALS[\'TYPO3_CONF_VARS\'][\'SYS\'][\'setDBinit\'] property with the following value:' . chr(10) .
+                               $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] . chr(10) . chr(10) .
+                               'It looks like UTF-8 is not used for this connection.' . chr(10) . chr(10) .
+                               'Everything other than UTF-8 is unsupported since TYPO3 4.7.' . chr(10) .
+                               'The DB, its connection and TYPO3 should be migrated to UTF-8 therefore. Please check your setup.'
+                       );
                } else {
                        $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] = 'SET NAMES utf8;';
                }