From ff51c5db50514aecceee6b8acddaff91b23a22bc Mon Sep 17 00:00:00 2001
From: Christian Kuhn <lolli@schwarzbu.ch>
Date: Wed, 16 May 2012 21:30:30 +0200
Subject: [PATCH] [TASK] CGL cleanup in bootstrap

Fix some cgl flaws that slipped through during the bootstrap refactoring.

Change-Id: Id2d122d0afdb3e0e1091a13eeecf62c1c67236f4
Resolves: #37236
Releases: 6.0
Reviewed-on: http://review.typo3.org/11261
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
---
 index.php                |  8 +++-----
 t3lib/config_default.php |  2 +-
 typo3/Bootstrap.php      | 16 ++++++++--------
 typo3/install/index.php  |  6 +++---
 4 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/index.php b/index.php
index 569bd659dcd2..438d5a24355f 100644
--- a/index.php
+++ b/index.php
@@ -24,11 +24,12 @@
 *
 *  This copyright notice MUST APPEAR in all copies of the script!
 ***************************************************************/
+
 /**
  * This is the MAIN DOCUMENT of the TypoScript driven standard front-end (from the "cms" extension)
  * Basically this is the "index.php" script which all requests for TYPO3 delivered pages goes to in the frontend (the website)
  *
- * @author	René Fritz <r.fritz@colorcube.de>
+ * @author René Fritz <r.fritz@colorcube.de>
  * @package TYPO3
  * @subpackage tslib
  */
@@ -40,8 +41,5 @@ Typo3_Bootstrap::defineAndCheckPaths('');
 Typo3_Bootstrap::requireBaseClasses();
 Typo3_Bootstrap::setUpEnvironment();
 
-// ******************
-// include TSFE
-// ******************
-require (PATH_tslib . 'index_ts.php');
+require(PATH_tslib . 'index_ts.php');
 ?>
\ No newline at end of file
diff --git a/t3lib/config_default.php b/t3lib/config_default.php
index d34484f8e8a7..c39fd99dee15 100644
--- a/t3lib/config_default.php
+++ b/t3lib/config_default.php
@@ -1063,7 +1063,7 @@ if(count($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']) > 0) {
 	// Error & Exception handling
 if ($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionHandler'] !== '') {
 	if ($TYPO3_CONF_VARS['SYS']['errorHandler'] !== '') {
-			// 	Register an error handler for the given errorHandlerErrors
+			// Register an error handler for the given errorHandlerErrors
 		$errorHandler = t3lib_div::makeInstance($TYPO3_CONF_VARS['SYS']['errorHandler'], $TYPO3_CONF_VARS['SYS']['errorHandlerErrors']);
 			// Set errors which will be converted in an exception
 		$errorHandler->setExceptionalErrors($TYPO3_CONF_VARS['SC_OPTIONS']['errors']['exceptionalErrors']);
diff --git a/typo3/Bootstrap.php b/typo3/Bootstrap.php
index 9a6d2cc541c8..923fbf9e845a 100644
--- a/typo3/Bootstrap.php
+++ b/typo3/Bootstrap.php
@@ -222,8 +222,8 @@ class Typo3_Bootstrap {
 			if (TYPO3_PROCEED_IF_NO_USER === 2) {
 				// Ajax poll for login, let it pass
 			} else {
-				$fileContent = t3lib_div::getUrl(PATH_typo3conf.'LOCK_BACKEND');
-				if ($fileContent)	{
+				$fileContent = t3lib_div::getUrl(PATH_typo3conf . 'LOCK_BACKEND');
+				if ($fileContent) {
 					header('Location: ' . $fileContent);
 				} else {
 					throw new RuntimeException(
@@ -270,17 +270,17 @@ class Typo3_Bootstrap {
 			}
 			if ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] == 3) {
 				$requestStr = substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_SCRIPT'), strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir));
-				if($requestStr == 'index.php' && !t3lib_div::getIndpEnv('TYPO3_SSL')) {
+				if ($requestStr === 'index.php' && !t3lib_div::getIndpEnv('TYPO3_SSL')) {
 					list(,$url) = explode('://', t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), 2);
 					list($server, $address) = explode('/', $url, 2);
 					header('Location: https://' . $server . $sslPortSuffix . '/' . $address);
 					exit;
 				}
-			} elseif (!t3lib_div::getIndpEnv('TYPO3_SSL') ) {
-				if ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL'] == 2) {
+			} elseif (!t3lib_div::getIndpEnv('TYPO3_SSL')) {
+				if (intval($GLOBALS['TYPO3_CONF_VARS']['BE']['lockSSL']) === 2) {
 					list(,$url) = explode('://', t3lib_div::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir, 2);
 					list($server, $address) = explode('/', $url, 2);
-					header('Location: https://'.$server . $sslPortSuffix . '/' . $address);
+					header('Location: https://' . $server . $sslPortSuffix . '/' . $address);
 				} else {
 						// Send Not Found header - if the webserver can make use of it...
 					header('Status: 404 Not Found');
@@ -351,7 +351,7 @@ class Typo3_Bootstrap {
 	 * @return void
 	 */
 	public static function initializeBackendUserMounts() {
-			// ! WILL INCLUDE deleted mount pages as well!
+			// Includes deleted mount pages as well! @TODO: Figure out why ...
 		$GLOBALS['WEBMOUNTS'] = $GLOBALS['BE_USER']->returnWebmounts();
 		$GLOBALS['FILEMOUNTS'] = $GLOBALS['BE_USER']->returnFilemounts();
 	}
@@ -374,7 +374,7 @@ class Typo3_Bootstrap {
 	 */
 	protected static function checkPhpVersionOrDie() {
 		if (version_compare(phpversion(), '5.3', '<')) {
-			die ('TYPO3 requires PHP 5.3.0 or higher.');
+			die('TYPO3 requires PHP 5.3.0 or higher.');
 		}
 	}
 
diff --git a/typo3/install/index.php b/typo3/install/index.php
index ca79a9a49062..1d633d8fd30e 100755
--- a/typo3/install/index.php
+++ b/typo3/install/index.php
@@ -27,14 +27,14 @@
 /**
  * Starter-script for install screen
  *
- * @author	Kasper Skårhøj <kasperYYYY@typo3.com>
+ * @author Kasper Skårhøj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage core
  */
 
 ob_start();
 
-define('TYPO3_MODE','BE');
+define('TYPO3_MODE', 'BE');
 define('TYPO3_enterInstallScript', '1');
 
 require('../Bootstrap.php');
@@ -58,7 +58,7 @@ Typo3_Bootstrap::checkBackendIpOrDie();
 Typo3_Bootstrap::checkSslBackendAndRedirectIfNeeded();
 
 	// Run install script
-if(!t3lib_extMgm::isLoaded('install')) {
+if (!t3lib_extMgm::isLoaded('install')) {
 	die('Install Tool is not loaded as an extension.<br />You must add the key "install" to the list of installed extensions in typo3conf/localconf.php, $TYPO3_CONF_VARS[\'EXT\'][\'extList\'].');
 }
 
-- 
GitLab