diff --git a/uoj/1/app/controllers/problem_data_manage.php b/uoj/1/app/controllers/problem_data_manage.php
index a9c3d7d..a7a225a 100644
--- a/uoj/1/app/controllers/problem_data_manage.php
+++ b/uoj/1/app/controllers/problem_data_manage.php
@@ -78,7 +78,8 @@ EOD;
becomeMsgPage('
' . $errmsg . '
返回');
}
else{
- //if($_FILES["problem_data_file"]["type"]=='application/zip'){
+ $zip_mime_types = array('application/zip', 'application/x-zip', 'application/x-zip-compressed');
+ if(in_array($_FILES["problem_data_file"]["type"], $zip_mime_types)){
$up_filename="/tmp/".rand(0,100000000)."data.zip";
move_uploaded_file($_FILES["problem_data_file"]["tmp_name"], $up_filename);
$zip = new ZipArchive;
@@ -92,10 +93,10 @@ EOD;
becomeMsgPage('' . $errmsg . '
返回');
}
unlink($up_filename);
- //}else{
- //$errmsg = "请上传zip文件!";
- //becomeMsgPage('' . $errmsg . '
返回');
- //}
+ }else{
+ $errmsg = "请上传zip文件!";
+ becomeMsgPage('' . $errmsg . '
返回');
+ }
}
}