From 203a3607d8cf327eabe63917a7b28ea9f8c4fa02 Mon Sep 17 00:00:00 2001 From: caoyanyi Date: Wed, 23 Mar 2022 11:32:56 +0800 Subject: [PATCH] * Adjust codes. --- module/install/model.php | 8 ++++++-- module/upgrade/model.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/module/install/model.php b/module/install/model.php index ecdc7c90bc..5961e2d9b2 100644 --- a/module/install/model.php +++ b/module/install/model.php @@ -502,10 +502,14 @@ class installModel extends model */ public function grantPriv() { + $data = fixer::input('post') + ->stripTags('company') + ->get(); + $requiredFields = explode(',', $this->config->install->step5RequiredFields); foreach($requiredFields as $field) { - if(empty($this->post->{$field})) + if(empty($data->{$field})) { dao::$errors[] = $this->lang->install->errorEmpty[$field]; return false; @@ -514,7 +518,7 @@ class installModel extends model /* Insert a company. */ $company = new stdclass(); - $company->name = strip_tags($this->post->company); + $company->name = $data->company; $company->admins = ",{$this->post->account},"; $this->dao->insert(TABLE_COMPANY)->data($company)->autoCheck()->exec(); if(!dao::isError()) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index f816b1b4d7..62f61e14e6 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -1260,7 +1260,7 @@ class upgradeModel extends model if(file_exists($fullPath)) { $isDir = is_dir($fullPath); - if(!is_writable($fullPath) or ($isDir and !$zfile->removeDir($fullPath)) or + if(!is_writable($fullPath) or ($isDir and !$zfile->removeDir($fullPath)) or (!$isDir and !$zfile->removeFile($fullPath))) { $result[] = 'rm -f ' . ($isDir ? '-r ' : '') . $fullPath;