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 {