[TASK] PHP 5.4 adjustments
authorMarkus Klein <klein.t3@mfc-linz.at>
Tue, 6 Mar 2012 10:42:54 +0000 (11:42 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 28 Jun 2012 19:55:01 +0000 (21:55 +0200)
Small adjustments for PHP 5.4 compatibility.

Change-Id: I5c551f3f66fe9f68dd4f1a16790dcf00e300c72a
Resolves: #34685
Releases: 4.8, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/11504
Reviewed-by: Oliver Klee
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Marcus Schwemer
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
t3lib/utility/class.t3lib_utility_phpoptions.php
typo3/init.php
typo3/sysext/reports/reports/status/class.tx_reports_reports_status_configurationstatus.php

index e4ab830..60cb43a 100644 (file)
@@ -41,7 +41,10 @@ final class t3lib_utility_PhpOptions {
         * @return boolean TRUE if safe_mode is enabled, FALSE if disabled
         */
        public static function isSafeModeEnabled() {
-               return self::getIniValueBoolean('safe_mode');
+               if (version_compare(phpversion(), '5.4', '<')) {
+                       return self::getIniValueBoolean('safe_mode');
+               }
+               return FALSE;
        }
 
        /**
index f1a93e3..85de722 100644 (file)
@@ -338,8 +338,10 @@ 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 (!version_compare(phpversion(), '5.4', '<') || !get_magic_quotes_gpc()) {
+if (isset($_POST['GLOBALS']) || isset($_GET['GLOBALS'])) {
+       die('You cannot set the GLOBALS-array from outside the script.');
+}
+if (!get_magic_quotes_gpc()) {
        t3lib_div::addSlashesOnArray($_GET);
        t3lib_div::addSlashesOnArray($_POST);
        $HTTP_GET_VARS = $_GET;
index 5b0a5ae..e9dc7f3 100644 (file)
@@ -56,9 +56,13 @@ class tx_reports_reports_status_ConfigurationStatus implements tx_reports_Status
                $statuses = array(
                        'emptyReferenceIndex' => $this->getReferenceIndexStatus(),
                        'deprecationLog'      => $this->getDeprecationLogStatus(),
-                       'safeModeEnabled'     => $this->getPhpSafeModeStatus()
                );
 
+                       // Do not show status about non-existant features
+               if (version_compare(phpversion(), '5.4', '<')) {
+                       $statuses['safeModeEnabled'] = $this->getPhpSafeModeStatus();
+               }
+
                if ($this->isMemcachedUsed()) {
                        $statuses['memcachedConnection'] = $this->getMemcachedConnectionStatus();
                }