From 04ab18076b5775461166549f9af078613a4b4887 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Tue, 28 Mar 2023 21:05:39 +0800 Subject: [PATCH] chore(submission): disable hack for remote submissions --- web/app/controllers/problem.php | 1 + web/app/models/UOJSubmission.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/web/app/controllers/problem.php b/web/app/controllers/problem.php index 959bc61..68e5177 100644 --- a/web/app/controllers/problem.php +++ b/web/app/controllers/problem.php @@ -109,6 +109,7 @@ function handleUpload($zip_file_name, $content, $tot_size) { if (UOJProblem::info('type') == 'remote') { $submit_type = in_array($_POST['answer_remote_submit_type'], $remote_provider['submit_type']) ? $_POST['answer_remote_submit_type'] : $remote_provider['submit_type'][0]; + $content['remote_judge'] = true; $content['config'][] = ['remote_submit_type', $submit_type]; if ($submit_type != 'bot') { diff --git a/web/app/models/UOJSubmission.php b/web/app/models/UOJSubmission.php index 79f5b17..ee0e0ef 100644 --- a/web/app/models/UOJSubmission.php +++ b/web/app/models/UOJSubmission.php @@ -480,6 +480,10 @@ class UOJSubmission { } public function preHackCheck(array $user = null) { + if ($this->getContent('remote_judge')) { + return false; + } + return $this->info['score'] == 100 && $this->problem->preHackCheck($user); }