diff --git a/web/app/controllers/problem_data_manage.php b/web/app/controllers/problem_data_manage.php index ca34b18..63dc15f 100644 --- a/web/app/controllers/problem_data_manage.php +++ b/web/app/controllers/problem_data_manage.php @@ -59,7 +59,7 @@ if ($_POST['problem_data_file_submit'] == 'submit') { if ($zip->open($up_filename) === TRUE) { $zip->extractTo("/var/uoj_data/upload/{$problem['id']}"); $zip->close(); - exec("cd /var/uoj_data/upload/{$problem['id']}; if [ `find . -maxdepth 1 -type f`File = File ]; then for sub_dir in `find -maxdepth 1 -type d ! -name .`; do mv -f \$sub_dir/* . && rm -rf \$sub_dir; done; fi"); + exec("cd /var/uoj_data/upload/{$problem['id']}; if [ -z "`find . -maxdepth 1 -type f`" ]; then for sub_dir in `find -maxdepth 1 -type d ! -name .`; do mv -f \$sub_dir/* . && rm -rf \$sub_dir; done; fi"); echo ""; } else { $errmsg = "解压失败!";