[BUGFIX] Install Tool: Improper check of PHP session.auto_start
authorMarkus Klein <klein.t3@mfc-linz.at>
Sun, 30 Oct 2011 00:16:31 +0000 (19:16 -0500)
committerXavier Perseguers <xavier@typo3.org>
Tue, 22 Nov 2011 14:08:38 +0000 (15:08 +0100)
This fix improves the check for the PHP session.auto_start configuration
to account also for valid Yes/No configuration values.

Change-Id: Icbbe4ed6afdb69642fc5a9ca3a86dc82cc066464
Fixes: #31404
Releases: 4.7, 4.6
Reviewed-on: http://review.typo3.org/6382
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
Reviewed-by: Stefan Neufeind
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
t3lib/utility/class.t3lib_utility_phpoptions.php
typo3/sysext/install/mod/class.tx_install_session.php

index 0875ebc..73daa74 100644 (file)
@@ -67,6 +67,15 @@ final class t3lib_utility_PhpOptions {
        }
 
        /**
+        * Check if php session.auto_start is enabled
+        *
+        * @return boolean TRUE if session.auto_start is enabled, FALSE if disabled
+        */
+       public static function isSessionAutoStartEnabled() {
+               return self::getIniValueBoolean('session.auto_start');
+       }
+
+       /**
         * Cast a on/off php ini value to boolean
         *
         * @return boolean TRUE if the given option is enabled, FALSE if disabled
index 8732494..2f7a046 100644 (file)
@@ -118,7 +118,7 @@ class tx_install_session {
                if (version_compare(phpversion(), '5.2', '<')) {
                        ini_set('session.cookie_httponly', TRUE);
                }
-               if (ini_get('session.auto_start')) {
+               if (t3lib_utility_PhpOptions::isSessionAutoStartEnabled()) {
                        $sessionCreationError = 'Error: session.auto-start is enabled.<br />';
                        $sessionCreationError .= 'The PHP option session.auto-start is enabled. Disable this option in php.ini or .htaccess:<br />';
                        $sessionCreationError .= '<pre>php_value session.auto_start Off</pre>';