mirror of
https://github.com/renbaoshuo/S2OJ.git
synced 2024-11-22 19:28:41 +00:00
fix(web/problem/manage/data): condition for subfolder
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
6b785e8bc7
commit
33779b1758
@ -59,7 +59,7 @@ if ($_POST['problem_data_file_submit'] == 'submit') {
|
|||||||
if ($zip->open($up_filename) === TRUE) {
|
if ($zip->open($up_filename) === TRUE) {
|
||||||
$zip->extractTo("/var/uoj_data/upload/{$problem['id']}");
|
$zip->extractTo("/var/uoj_data/upload/{$problem['id']}");
|
||||||
$zip->close();
|
$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>";
|
echo "<script>alert('上传成功!')</script>";
|
||||||
} else {
|
} else {
|
||||||
$errmsg = "解压失败!";
|
$errmsg = "解压失败!";
|
||||||
|
Loading…
Reference in New Issue
Block a user