From 46592477c512fbf7e89a8e669318e9560a161b5a Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Mon, 6 Feb 2023 11:43:18 +0800 Subject: [PATCH] fix: 779480060355d8b2a018f290048218144a560c53 --- web/app/controllers/problem.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/web/app/controllers/problem.php b/web/app/controllers/problem.php index 120b17d..9d1c355 100644 --- a/web/app/controllers/problem.php +++ b/web/app/controllers/problem.php @@ -120,16 +120,15 @@ function handleUpload($zip_file_name, $content, $tot_size) { $content['remote_submission_id'] = $_POST['answer_remote_submission_id']; $content['config'][] = ['remote_submission_id', $_POST['answer_remote_submission_id']]; - $content['config'] = array_filter( + $content['config'] = array_values(array_filter( $content['config'], - function ($key) { - return !strEndWith($key, '_language'); + function ($row) { + return !strEndWith($row[0], '_language'); }, - ARRAY_FILTER_USE_KEY - ); + )); $zip_file = new ZipArchive(); - $zip_file->open(UOJContext::storagePath() . $zip_file_name, ZipArchive::CREATE); + $zip_file->open(UOJContext::storagePath() . $zip_file_name, ZipArchive::OVERWRITE); $zip_file->addFromString('answer.code', ''); $zip_file->close(); }