From dda760eca1eaa3b3daca0e0198749648691f996d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=A0=20=E6=81=A9=E6=A8=B9?= Date: Thu, 18 Jan 2024 16:50:10 +0900 Subject: [PATCH] 20240118 fix limit delivery input --- src/Eccube/Controller/ShoppingController.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Eccube/Controller/ShoppingController.php b/src/Eccube/Controller/ShoppingController.php index 5117fd9421d..2bb41be84cd 100644 --- a/src/Eccube/Controller/ShoppingController.php +++ b/src/Eccube/Controller/ShoppingController.php @@ -40,6 +40,7 @@ use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\TooManyRequestsHttpException; +use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\RateLimiter\RateLimiterFactory; use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\RouterInterface; @@ -666,6 +667,12 @@ public function shippingEdit(Request $request, Shipping $Shipping) return $this->redirectToRoute('shopping_error'); } + $Customer = $this->getUser(); + $addressCurrNum = count($Customer->getCustomerAddresses()); + $addressMax = $this->eccubeConfig['eccube_deliv_addr_max']; + if ($addressCurrNum >= $addressMax) { + throw new NotFoundHttpException(); + } $CustomerAddress = new CustomerAddress(); if ($this->isGranted('IS_AUTHENTICATED_FULLY')) { // ログイン時は会員と紐付け