From ae57feebb6e38a28c1e0d940b64a1730ec5fc840 Mon Sep 17 00:00:00 2001 From: Karson Date: Thu, 14 Dec 2023 17:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AF=AD=E8=A8=80=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E6=9C=AA=E5=8C=B9=E9=85=8D=E6=97=B6=E7=9A=84=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化分片上传 --- application/common/library/Upload.php | 2 +- application/common/view/tpl/think_exception.tpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/common/library/Upload.php b/application/common/library/Upload.php index 995cf1a2..19697337 100644 --- a/application/common/library/Upload.php +++ b/application/common/library/Upload.php @@ -305,7 +305,7 @@ class Upload $attachment = $this->upload(); } catch (\Exception $e) { - @unlink($destFile); + @unlink($uploadPath); throw new UploadException($e->getMessage()); } return $attachment; diff --git a/application/common/view/tpl/think_exception.tpl b/application/common/view/tpl/think_exception.tpl index 94142202..33967c95 100755 --- a/application/common/view/tpl/think_exception.tpl +++ b/application/common/view/tpl/think_exception.tpl @@ -19,7 +19,7 @@ if (isset($_GET['lang'])) { $langSet = strtolower($_COOKIE['think_var']); } elseif (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { preg_match('/^([a-z\d\-]+)/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches); - $langSet = strtolower($matches[1]); + $langSet = strtolower($matches[1] ?? ''); } $langSet = $langSet && in_array($langSet, ['zh-cn', 'en']) ? $langSet : 'zh-cn'; $langSet == 'en' && $lang = array_combine(array_keys($lang), array_keys($lang));