Skip to content

Commit 2cd0f38

Browse files
authored
Add files via upload
1 parent b884ba0 commit 2cd0f38

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

trunk/web/admin/problem_import_hydro.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ function import_dir($json) {
268268
}
269269

270270
file_put_contents($OJ_DATA . "/$pid/" . $dataname, $file_content);
271+
} elseif (strpos($file_path, "std") !== false && basename($file_name) != "std") {
272+
$dataname = basename($file_name);
273+
if ($dataname=="main.cpp") $dataname="Main.cc";
274+
if (endsWith($dataname, ".cpp")||endsWith($dataname, ".cc")||endsWith($dataname, ".py")) {
275+
file_put_contents($OJ_DATA . "/$pid/" . $dataname, $file_content);
276+
}
271277
} elseif (strpos($file_path, "additional_file") !== false && basename($file_name) != "additional_file") {
272278
$ext = strtolower(get_extension($file_name));
273279

0 commit comments

Comments
 (0)