20121004_Patch_41596_4.7.4.diff

Jörg Wagner, 2012-10-04 18:21

Download (1.55 KB)

View differences:

TYPO3\typo3_src-4.7.4_PATCHED/t3lib/config_default.php 2012-10-04 18:12:13.000000000 +0200
834 834
		unset($TYPO3_CONF_VARS['BE']['forceCharset']);
835 835
	}
836 836
}
837 837

  
838 838
if (isset($TYPO3_CONF_VARS['SYS']['setDBinit']) &&
839 839
	$TYPO3_CONF_VARS['SYS']['setDBinit'] !== '-1' &&
840
	preg_match('/SET NAMES utf8/', $TYPO3_CONF_VARS['SYS']['setDBinit']) === FALSE &&
840
	preg_match('/SET NAMES/i', $TYPO3_CONF_VARS['SYS']['setDBinit']) > 0 &&
841 841
	TYPO3_enterInstallScript !== '1'
842 842
) {
843 843
		// Only accept "SET NAMES utf8" for this setting, otherwise die with a nice error
844 844
	die('This TYPO3 installation is using the $TYPO3_CONF_VARS[\'SYS\'][\'setDBinit\'] property with the following value:' . chr(10) .
845 845
		$TYPO3_CONF_VARS['SYS']['setDBinit'] . chr(10) . chr(10) .
846
		'It looks like UTF-8 is not used for this connection.' . chr(10) . chr(10) .
847
		'Everything other than UTF-8 is unsupported since TYPO3 4.7.' . chr(10) .
848
		'The DB, its connection and TYPO3 should be migrated to UTF-8 therefore. Please check your setup.');
846
		'SET NAMES defaults to UTF-8 since TYPO3 4.7 and changing its value is not supported anymore.' . chr(10) .
847
		'Using SET NAMES in [\'SYS\'][\'setDBinit\'] is therefore not allowed.' . chr(10) .
848
		'The DB, its connection and your TYPO3 installation should be migrated to UTF-8. Please check your setup.');
849 849
} else {
850
	$TYPO3_CONF_VARS['SYS']['setDBinit'] = 'SET NAMES utf8;';
850
	$TYPO3_CONF_VARS['SYS']['setDBinit'] .=  LF . 'SET NAMES utf8;';
851 851
}