[TASK] Remove last bits of forceCharset handling 84/21584/4
authorChristian Kuhn <lolli@schwarzbu.ch>
Fri, 21 Jun 2013 21:55:24 +0000 (23:55 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 23 Jun 2013 09:42:27 +0000 (11:42 +0200)
Core version 4.5 introduced UTF8 only for charset conversion, and
accepted a fallback under special circumstances. The fallback was
removed with 4.7.
This setting is now finally fully removed from the configuration
and not taken into account anymore.

Change-Id: Ic347c3decb985ec63eb499d5d75827fc7f1f7a8a
Resolves: #49336
Related: #49299
Related: #34092
Releases: 6.2
Reviewed-on: https://review.typo3.org/21584
Reviewed-by: Markus Klein
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Classes/Core/Bootstrap.php
typo3/sysext/core/Configuration/FactoryConfiguration.php
typo3/sysext/fluid/Classes/ViewHelpers/Format/CropViewHelper.php
typo3/sysext/install/Classes/Controller/StepController.php
typo3/sysext/install/Classes/CoreUpdates/CharsetDefaultsUpdate.php

index 17964c1..1af33bb 100644 (file)
@@ -342,30 +342,12 @@ class Bootstrap {
         *
         * Since TYPO3 4.5, everything other than UTF-8 is deprecated.
         *
-        * [BE][forceCharset] is set to the charset that TYPO3 is using
         * [SYS][setDBinit] is used to set the DB connection
         * and both settings need to be adjusted for UTF-8 in order to work properly
         *
         * @return \TYPO3\CMS\Core\Core\Bootstrap
         */
        protected function checkUtf8DatabaseSettingsOrDie() {
-               // 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.'
-                               );
-                       } 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[\'"]?/i', $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit']) === FALSE &&
index 7dd34f6..75dbc55 100644 (file)
@@ -10,7 +10,6 @@ return array(
                'explicitADmode' => 'explicitAllow',
                'fileCreateMask' => '0664',
                'folderCreateMask' => '2774',
-               'forceCharset' => 'utf-8',
                'installToolPassword' => 'bacb98acf97e0b6112b1d1b650b84971',
        ),
        'DB' => array(
index fe433a6..a118d8c 100644 (file)
@@ -127,7 +127,7 @@ class CropViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
                        if (is_object($GLOBALS['LANG'])) {
                                $GLOBALS['TSFE']->renderCharset = $GLOBALS['LANG']->charSet;
                        } else {
-                               $GLOBALS['TSFE']->renderCharset = $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'];
+                               $GLOBALS['TSFE']->renderCharset = 'utf-8';
                        }
                }
        }
index dbcffc7..544f676 100644 (file)
@@ -46,8 +46,8 @@ class StepController extends AbstractController {
         * @var array List of obsolete configuration options in LocalConfiguration to be removed
         */
        protected $obsoleteLocalConfigurationSettings = array(
-               // @TODO: #34092 - Remove it? Still used in core
-               // 'BE/forceCharset',
+               // #34092
+               'BE/forceCharset',
                // #26519
                'BE/loginLabels',
                // #44506
@@ -70,7 +70,7 @@ class StepController extends AbstractController {
                'FE/simulateStaticDocuments',
                // #22687
                'GFX/gdlib_2',
-               // # ?
+               // #18431
                'GFX/noIconProc',
                // #17606
                'GFX/TTFLocaleConv',
index eebf473..ef04ff2 100644 (file)
@@ -42,10 +42,10 @@ class CharsetDefaultsUpdate extends \TYPO3\CMS\Install\Updates\AbstractUpdate {
         * @return      boolean         whether an update is needed (TRUE) or not (FALSE)
         */
        public function checkForUpdate(&$description, &$showUpdate = FALSE) {
-               if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset']) && $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] != '' && $GLOBALS['TYPO3_CONF_VARS']['BE']['forceCharset'] != 'utf-8' || $GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] === '-1') {
-                       $description = 'The configuration variables $TYPO3_CONF_VARS[\'SYS\'][\'setDBinit\'] and/or
-                               $TYPO3_CONF_VARS[\'BE\'][\'forceCharset\'] are relying on empty default values.<br />
-                               However, the defaults for both values have changed in TYPO3 4.5.<br /><br />
+               if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['setDBinit'] === '-1') {
+                       $description = 'The configuration variables $TYPO3_CONF_VARS[\'SYS\'][\'setDBinit\']
+                               is relying on empty default values.<br />
+                               However, the default has changed in TYPO3 4.5.<br /><br />
                                Please click "Next" to write the former default settings to your localconf.php,
                                so that your setup will continue to work like before.';
                        $showUpdate = 1;
@@ -67,12 +67,7 @@ class CharsetDefaultsUpdate extends \TYPO3\CMS\Install\Updates\AbstractUpdate {
                if (\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->getLocalConfigurationValueByPath('SYS/setDBinit') === '-1') {
                        $result1 = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->setLocalConfigurationValueByPath('SYS/setDBinit', '');
                }
-               // Update the "forceCharset" setting
-               $result2 = FALSE;
-               if (\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->getLocalConfigurationValueByPath('BE/forceCharset') !== '') {
-                       $result2 = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Configuration\\ConfigurationManager')->setLocalConfigurationValueByPath('BE/forceCharset', '');
-               }
-               if ($result1 && $result2) {
+               if ($result1) {
                        $customMessages[] = 'The configuration was successfully updated.';
                        return TRUE;
                } else {