From e70cb57176bc036d8ed05bb4b4685321f385441f Mon Sep 17 00:00:00 2001 From: Lang <7system7@gmail.com> Date: Mon, 21 Sep 2026 10:23:38 +0200 Subject: [PATCH] chg: usr: completely disable the contact form #15 --- src/Controller/GameController.php | 6 ++++-- templates/Game/index.html.twig | 1 - tests/Controller/GameControllerTest.php | 8 +++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Controller/GameController.php b/src/Controller/GameController.php index d307cf3..d178442 100644 --- a/src/Controller/GameController.php +++ b/src/Controller/GameController.php @@ -21,7 +21,6 @@ use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Attribute\AsController; -use Symfony\Component\Mailer\MailerInterface; use Symfony\Component\Routing\Attribute\Route; /** @@ -85,8 +84,11 @@ class GameController extends AbstractController public function contact( Request $request, EntityManagerInterface $em, - MailerInterface $mailer, ): Response { + // Keep the contact form implementation available, but disable public + // access while automated abuse protection is insufficient. + throw $this->createNotFoundException(); + $contactMessage = new ContactMessage(); $form = $this->createForm(ContactFormType::class, $contactMessage); $form->handleRequest($request); diff --git a/templates/Game/index.html.twig b/templates/Game/index.html.twig index b9b5fbc..55c2b30 100644 --- a/templates/Game/index.html.twig +++ b/templates/Game/index.html.twig @@ -260,7 +260,6 @@