[BUGFIX] Allow redirect from typo3/install again 62/57262/2
authorBenni Mack <benni@typo3.org>
Mon, 18 Jun 2018 16:16:37 +0000 (18:16 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 20 Jun 2018 08:08:28 +0000 (10:08 +0200)
Due to refactorings of constants, Environment:isCli()
needs to be initialized now. This breaks the
existing redirect from typo3/install/ to
typo3/install.php, due to non-initialized Environment

In this case, the environment is initialized.

Resolves: #85306
Releases: master
Change-Id: I20a86f4a304951b7b075a3eec7142c4e1c99d06c
Reviewed-on: https://review.typo3.org/57262
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>

index 25b996a..d1dee35 100644 (file)
@@ -13,11 +13,13 @@ call_user_func(function () {
     // This way we do not need to copy all the code here to cope with correct location header URL generation correctly
     // as those two classes can already correctly deal with all known edge cases.
-    require __DIR__ . '/../../vendor/autoload.php';
+    $classLoader = require __DIR__ . '/../../vendor/autoload.php';
     // We ensure that possible notices from Core code do not kill our redirect due to PHP output
     error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
     // @deprecated in 9.x will be removed in 10.0
+    \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::run(2, \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder::REQUESTTYPE_INSTALL);
+    \TYPO3\CMS\Core\Core\Bootstrap::init($classLoader, true);
     \TYPO3\CMS\Core\Utility\HttpUtility::redirect('../install.php', \TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_307);