From dabe30f67d058a4b07ddc0603f9c153d8b49cd70 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Mon, 17 Apr 2023 13:56:33 +0800 Subject: [PATCH] * Code for bug 34254, Modify file remove error. --- module/install/control.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/install/control.php b/module/install/control.php index 211a03661a..450b308cdf 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -296,12 +296,13 @@ class install extends control */ public function step6() { - $installFileDeleted = unlink($this->app->getAppRoot() . 'www/install.php'); + $canDelFile = is_writable($this->app->getAppRoot() . 'www'); + $installFileDeleted = $canDelFile ? unlink($this->app->getAppRoot() . 'www/install.php') : false; $this->view->installFileDeleted = $installFileDeleted; $this->view->title = $this->lang->install->success; $this->display(); - unlink($this->app->getAppRoot() . 'www/upgrade.php'); + if($canDelFile) unlink($this->app->getAppRoot() . 'www/upgrade.php'); unset($_SESSION['installing']); session_destroy(); }