From 92f572323116cec80998dc894af15529566d9ea2 Mon Sep 17 00:00:00 2001 From: Michael Vasseur <14887731+vmcj@users.noreply.github.com> Date: Sat, 29 Nov 2025 17:07:54 +0100 Subject: [PATCH] Disallow sending clarifications before the contest has started. --- webapp/src/Controller/API/ClarificationController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webapp/src/Controller/API/ClarificationController.php b/webapp/src/Controller/API/ClarificationController.php index a502b64c82..63207e1ab7 100644 --- a/webapp/src/Controller/API/ClarificationController.php +++ b/webapp/src/Controller/API/ClarificationController.php @@ -198,6 +198,11 @@ public function addAction( } $time = Utils::now(); + if ($contest->getStartTime() > $time) { + throw new BadRequestHttpException( + "Sending clarifications via API before the contest is not allowed." + ); + } if ($timeString = $clarificationPost->time) { if ($this->isGranted('ROLE_API_WRITER')) { try {