[BUGFIX] magic_quotes_gpc does not exist anymore in PHP 5.4
authorXavier Perseguers <xavier@typo3.org>
Tue, 20 Sep 2011 09:36:58 +0000 (11:36 +0200)
committerXavier Perseguers <xavier@typo3.org>
Tue, 22 Nov 2011 10:07:49 +0000 (11:07 +0100)
PHP INI magic_quotes_gpc got deprecated in PHP 5.3 and is removed in
PHP 5.4, init.php should then behave as if it were set to "Off".

Change-Id: Ifcd4fb7cc9c2cb23ba6d910ffbe6cc034a66cdbd
Fixes: #30083
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/6833
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/init.php

index aa1f048..f1a93e3 100644 (file)
@@ -339,7 +339,7 @@ if (intval($TYPO3_CONF_VARS['BE']['lockSSL']) && !(TYPO3_REQUESTTYPE & TYPO3_REQ
 // Checking environment
 // *******************************
 if (isset($_POST['GLOBALS']) || isset($_GET['GLOBALS']))       die('You cannot set the GLOBALS-array from outside the script.');
-if (!get_magic_quotes_gpc())   {
+if (!version_compare(phpversion(), '5.4', '<') || !get_magic_quotes_gpc()) {
        t3lib_div::addSlashesOnArray($_GET);
        t3lib_div::addSlashesOnArray($_POST);
        $HTTP_GET_VARS = $_GET;