[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:04:30 +0000 (11:04 +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: I14fac85ef5f3dca86e1bd424ab0be4a37b9f331b
Fixes: #30083
Releases: 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/5104
Reviewed-by: Ernesto Baschny
Reviewed-by: Georg Ringer
Reviewed-by: Karsten Dambekalns
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
typo3/init.php

index d216af8..ba586b7 100644 (file)
@@ -325,7 +325,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;