Skip to content

Commit

Permalink
fix(web/app/controllers): Fix condition for subfolder (#116)
Browse files Browse the repository at this point in the history
See #49 and bd74ed3

Co-authored-by: Piggy <piggynl@outlook.com>
  • Loading branch information
billchenchina and piggynl authored Nov 4, 2022
1 parent c5c8ce0 commit fc10fed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/app/controllers/problem_data_manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function echoFilePre($file_name) {
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 "<script>alert('上传成功!')</script>";
} else {
$errmsg = "解压失败!";
Expand Down

0 comments on commit fc10fed

Please sign in to comment.