From d38b9115c5c0be011da640cbd313c0818a8f4efd Mon Sep 17 00:00:00 2001 From: xjrjyy <58362943+xjrjyy@users.noreply.github.com> Date: Sun, 6 Sep 2020 17:04:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E7=81=AB=E7=8B=90=E6=B5=8F?= =?UTF-8?q?=E8=A7=88=E5=99=A8=E4=B8=8A=E4=BC=A0=E6=95=B0=E6=8D=AE=E2=80=9C?= =?UTF-8?q?=E8=AF=B7=E4=B8=8A=E4=BC=A0zip=E6=A0=BC=E5=BC=8F=EF=BC=81?= =?UTF-8?q?=E2=80=9D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/app/controllers/problem_data_manage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/app/controllers/problem_data_manage.php b/web/app/controllers/problem_data_manage.php index 138ae69..51bbd6f 100644 --- a/web/app/controllers/problem_data_manage.php +++ b/web/app/controllers/problem_data_manage.php @@ -50,7 +50,7 @@ becomeMsgPage('
' . $errmsg . '
返回'); } else { $zip_mime_types = array('application/zip', 'application/x-zip', 'application/x-zip-compressed'); - if (in_array($_FILES["problem_data_file"]["type"], $zip_mime_types)) { + if (in_array($_FILES["problem_data_file"]["type"], $zip_mime_types) || $_FILES["problem_data_file"]["type"] == 'application/octet-stream' && substr($_FILES["problem_data_file"]["name"], -4) == '.zip') { $up_filename="/tmp/".rand(0,100000000)."data.zip"; move_uploaded_file($_FILES["problem_data_file"]["tmp_name"], $up_filename); $zip = new ZipArchive;