From 8203516fdd6a9ba7adc44c4d0e79dff1fb2b7b81 Mon Sep 17 00:00:00 2001 From: Panos Syskakis Date: Sat, 13 Dec 2025 18:42:44 -0600 Subject: [PATCH 1/3] Fix server error when submitting on non-existent project --- app/Http/Controllers/SubmissionController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/SubmissionController.php b/app/Http/Controllers/SubmissionController.php index 79b4e5c346..8ca9828ae3 100644 --- a/app/Http/Controllers/SubmissionController.php +++ b/app/Http/Controllers/SubmissionController.php @@ -152,9 +152,6 @@ private function submitProcess(): Response $this->project = new Project(); $this->project->FindByName($projectname); - // Remove some old builds if the project has too many. - $this->project->CheckForTooManyBuilds(); - // Check for valid authentication token if this project requires one. if ($this->project->AuthenticateSubmissions && !AuthTokenUtil::checkToken($authtoken_hash, $this->project->Id)) { Storage::delete("inbox/{$filename}"); @@ -165,6 +162,9 @@ private function submitProcess(): Response $this->failProcessing($filename, Response::HTTP_NOT_FOUND, 'The requested project does not exist.'); } + // Remove some old builds if the project has too many. + $this->project->CheckForTooManyBuilds(); + // Figure out what type of XML file this is. $stored_filename = 'inbox/' . $filename; $xml_info = SubmissionUtils::get_xml_type(Storage::readStream($stored_filename), $stored_filename); From 87d7e2f8b778359145d301a099251dad894f4aee Mon Sep 17 00:00:00 2001 From: Panos Syskakis Date: Sun, 14 Dec 2025 13:20:38 -0600 Subject: [PATCH 2/3] Fix server error when submitting on non-existent project --- app/Http/Controllers/SubmissionController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/SubmissionController.php b/app/Http/Controllers/SubmissionController.php index 8ca9828ae3..f1fa84c0aa 100644 --- a/app/Http/Controllers/SubmissionController.php +++ b/app/Http/Controllers/SubmissionController.php @@ -150,16 +150,18 @@ private function submitProcess(): Response // We can't use the usual $this->setProjectByName() function here because the auth token we have might not allow // full access to the project. E.g., it might be a submit-only token. $this->project = new Project(); - $this->project->FindByName($projectname); + + if (!$this->project->FindByName($projectname) || intval($this->project->Id) < 1) { + Storage::delete("inbox/{$filename}"); + Log::info("Rejected submission with invalid project name: $projectname"); + $this->failProcessing($filename, Response::HTTP_NOT_FOUND, 'The requested project does not exist.'); + } // Check for valid authentication token if this project requires one. if ($this->project->AuthenticateSubmissions && !AuthTokenUtil::checkToken($authtoken_hash, $this->project->Id)) { Storage::delete("inbox/{$filename}"); Log::info('Rejected submission with invalid authentication token'); $this->failProcessing(null, Response::HTTP_FORBIDDEN, 'Invalid Token'); - } elseif ((int) $this->project->Id < 1) { - Log::info("Rejected submission with invalid project name: $projectname"); - $this->failProcessing($filename, Response::HTTP_NOT_FOUND, 'The requested project does not exist.'); } // Remove some old builds if the project has too many. From d307ac3618d5073c40e2f5ba7f942179eedda2ec Mon Sep 17 00:00:00 2001 From: William Allen <16820599+williamjallen@users.noreply.github.com> Date: Mon, 29 Dec 2025 18:01:09 -0500 Subject: [PATCH 3/3] Minor updates --- app/Http/Controllers/SubmissionController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/SubmissionController.php b/app/Http/Controllers/SubmissionController.php index f1fa84c0aa..46bf5bd6e7 100644 --- a/app/Http/Controllers/SubmissionController.php +++ b/app/Http/Controllers/SubmissionController.php @@ -150,8 +150,8 @@ private function submitProcess(): Response // We can't use the usual $this->setProjectByName() function here because the auth token we have might not allow // full access to the project. E.g., it might be a submit-only token. $this->project = new Project(); - - if (!$this->project->FindByName($projectname) || intval($this->project->Id) < 1) { + + if (!$this->project->FindByName($projectname)) { Storage::delete("inbox/{$filename}"); Log::info("Rejected submission with invalid project name: $projectname"); $this->failProcessing($filename, Response::HTTP_NOT_FOUND, 'The requested project does not exist.');