From 0bf488efb178b5205837b86f709a402d15b512c5 Mon Sep 17 00:00:00 2001
From: Michael Stucki <michael.stucki@typo3.org>
Date: Mon, 20 Mar 2017 14:04:43 +0100
Subject: [PATCH] [BUGFIX] Check if install tool enable file exists before
 removing it

The is_file() check got lost during the refactoring in
d855b4707ba1198b6c1dbf856c4377e230da4c4b.

Change-Id: Ia1688099a7ccd32667562e8c7f83fd54bb669f4a
Resolves: #80354
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/52100
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Josef Glatz <josef.glatz@typo3.org>
Tested-by: Josef Glatz <josef.glatz@typo3.org>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../Classes/Controller/Action/Step/DefaultConfiguration.php     | 2 +-
 typo3/sysext/install/Classes/Controller/ToolController.php      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php b/typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php
index 0cad1c679bcc..df7e03fbcc86 100644
--- a/typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php
+++ b/typo3/sysext/install/Classes/Controller/Action/Step/DefaultConfiguration.php
@@ -133,7 +133,7 @@ For each website you need a TypoScript template on the main page of your website
         );
         $formProtection->clean();
 
-        if (!EnableFileService::isInstallToolEnableFilePermanent()) {
+        if (EnableFileService::installToolEnableFileExists() && !EnableFileService::isInstallToolEnableFilePermanent()) {
             EnableFileService::removeInstallToolEnableFile();
         }
 
diff --git a/typo3/sysext/install/Classes/Controller/ToolController.php b/typo3/sysext/install/Classes/Controller/ToolController.php
index efabeb968c6a..1459ead36c8c 100644
--- a/typo3/sysext/install/Classes/Controller/ToolController.php
+++ b/typo3/sysext/install/Classes/Controller/ToolController.php
@@ -73,7 +73,7 @@ class ToolController extends AbstractController
     {
         $action = $this->getAction();
         if ($action === 'logout') {
-            if (!EnableFileService::isInstallToolEnableFilePermanent()) {
+            if (EnableFileService::installToolEnableFileExists() && !EnableFileService::isInstallToolEnableFilePermanent()) {
                 EnableFileService::removeInstallToolEnableFile();
             }
 
-- 
GitLab