From 18cc8a8b30db78d6ee371123c50c754aabf27966 Mon Sep 17 00:00:00 2001 From: LeTanNghia Date: Wed, 7 Sep 2022 15:45:58 +0700 Subject: [PATCH] set upper limit issue/5709 --- src/Eccube/Form/Type/Admin/DeliveryType.php | 3 +++ src/Eccube/Form/Type/Admin/ProductType.php | 1 + src/Eccube/Form/Type/Front/ContactType.php | 1 + 3 files changed, 5 insertions(+) diff --git a/src/Eccube/Form/Type/Admin/DeliveryType.php b/src/Eccube/Form/Type/Admin/DeliveryType.php index 40b69205b22..f7820b0d8fb 100644 --- a/src/Eccube/Form/Type/Admin/DeliveryType.php +++ b/src/Eccube/Form/Type/Admin/DeliveryType.php @@ -60,6 +60,9 @@ public function buildForm(FormBuilderInterface $builder, array $options) ]) ->add('description', TextareaType::class, [ 'required' => false, + 'constraints' => [ + new Assert\Length(['max' => $this->eccubeConfig['eccube_ltext_len']]), + ], ]) ->add('confirm_url', TextType::class, [ 'required' => false, diff --git a/src/Eccube/Form/Type/Admin/ProductType.php b/src/Eccube/Form/Type/Admin/ProductType.php index 9b6cbceaa2e..07c86195ebe 100644 --- a/src/Eccube/Form/Type/Admin/ProductType.php +++ b/src/Eccube/Form/Type/Admin/ProductType.php @@ -130,6 +130,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) 'required' => false, 'constraints' => [ new TwigLint(), + new Assert\Length(['max' => $this->eccubeConfig['eccube_lltext_len']]), ], ]) diff --git a/src/Eccube/Form/Type/Front/ContactType.php b/src/Eccube/Form/Type/Front/ContactType.php index 7d3096dd206..fb8092a4750 100644 --- a/src/Eccube/Form/Type/Front/ContactType.php +++ b/src/Eccube/Form/Type/Front/ContactType.php @@ -73,6 +73,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) ->add('contents', TextareaType::class, [ 'constraints' => [ new Assert\NotBlank(), + new Assert\Length(['max' => $this->eccubeConfig['eccube_ltext_len']]), ], ]); }