diff --git a/app/admin/controller/api/Upload.php b/app/admin/controller/api/Upload.php index 91ee0c840..2f6848580 100644 --- a/app/admin/controller/api/Upload.php +++ b/app/admin/controller/api/Upload.php @@ -116,7 +116,7 @@ class Upload extends Controller $this->error('文件路径不能出现跳级操作!'); } // 检查文件后缀是否被恶意修改 - if (pathinfo(parse_url($saveName, PHP_URL_PATH), PATHINFO_EXTENSION) !== $extension) { + if (strtolower(pathinfo(parse_url($saveName, PHP_URL_PATH), PATHINFO_EXTENSION)) !== $extension) { $this->error('文件后缀异常,请重新上传文件!'); } // 屏蔽禁止上传指定后缀的文件