From 2038329114f83e0c8b0259dff5867ff371244a23 Mon Sep 17 00:00:00 2001 From: Stefan Oderbolz Date: Mon, 27 May 2013 16:27:36 +0200 Subject: [PATCH] [Form] [Validator] Fixed post_max_size = 0 bug (Issue #8065) --- .../Form/Extension/Validator/Constraints/FormValidator.php | 2 +- .../Tests/Extension/Validator/Constraints/FormValidatorTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php b/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php index c0c2085b9b3a2..0f0690106086d 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php +++ b/src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php @@ -126,7 +126,7 @@ public function validate($form, Constraint $constraint) if ($form->isRoot() && null !== $length) { $max = $this->serverParams->getPostMaxSize(); - if (null !== $max && $length > $max) { + if (!empty($max) && $length > $max) { $this->context->addViolation( $config->getOption('post_max_size_message'), array('{{ max }}' => $this->serverParams->getNormalizedIniPostMaxSize()), diff --git a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php index b6e3f82c4d4ed..9263b71e2c651 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php @@ -520,6 +520,7 @@ public function getPostMaxSizeFixtures() array(1024, '1K', 0, null), array(null, '1K', 0, null), array(1024, '', 0, null), + array(1024, 0, 0, null), ); } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy