From d1e9e72401fac89d7cbbf5d97f37efe9213f35da Mon Sep 17 00:00:00 2001 From: ghost Date: Sat, 4 Nov 2023 11:04:05 +0200 Subject: [PATCH] disallow toggleStar method for crawlers --- src/Controller/UserController.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Controller/UserController.php b/src/Controller/UserController.php index ae31028..538af56 100644 --- a/src/Controller/UserController.php +++ b/src/Controller/UserController.php @@ -318,6 +318,12 @@ class UserController extends AbstractController ); } + // Block crawler requests + if (in_array($request->getClientIp(), explode('|', $this->getParameter('app.crawlers')))) + { + throw $this->createNotFoundException(); + } + // Init target user if (!$userTarget = $userService->getUser($request->get('userId'))) {