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));