From 2f962c8f2eac4e3800fad3a45a21cea9b5a3c3bd Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Tue, 18 Apr 2023 14:28:12 +0800 Subject: [PATCH] * Modify unlink file. --- module/install/control.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/module/install/control.php b/module/install/control.php index 450b308cdf..b550680de9 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -296,14 +296,17 @@ class install extends control */ public function step6() { - $canDelFile = is_writable($this->app->getAppRoot() . 'www'); - $installFileDeleted = $canDelFile ? unlink($this->app->getAppRoot() . 'www/install.php') : false; + $canDelFile = is_writable($this->app->getAppRoot() . 'www'); + $installFile = $this->app->getAppRoot() . 'www/install.php'; + $upgradeFile = $this->app->getAppRoot() . 'www/upgrade.php'; + $installFileDeleted = $canDelFile && is_writable($installFile) ? unlink($installFile) : false; + + if($canDelFile and is_writable($upgradeFile)) unlink($upgradeFile); + unset($_SESSION['installing']); + session_destroy(); + $this->view->installFileDeleted = $installFileDeleted; $this->view->title = $this->lang->install->success; $this->display(); - - if($canDelFile) unlink($this->app->getAppRoot() . 'www/upgrade.php'); - unset($_SESSION['installing']); - session_destroy(); } }