[Form] [Validator] Fixed post_max_size = 0 bug (Issue #8065)

This commit is contained in:
Stefan Oderbolz 2013-05-27 16:27:36 +02:00
parent d52d9aeba0
commit 2038329114
2 changed files with 2 additions and 1 deletions

View File

@ -126,7 +126,7 @@ class FormValidator extends ConstraintValidator
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()),

View File

@ -520,6 +520,7 @@ class FormValidatorTest extends \PHPUnit_Framework_TestCase
array(1024, '1K', 0, null),
array(null, '1K', 0, null),
array(1024, '', 0, null),
array(1024, 0, 0, null),
);
}