From 64232a8ecebedcf8a05c3f6b5afe9854b6155f7b Mon Sep 17 00:00:00 2001 From: Tristan Bessoussa Date: Mon, 15 Apr 2013 11:42:43 +0300 Subject: [PATCH] Fix error where form cannot be submitted because of post_max_size=0 Symfony triggers an error on form submission if we set the post_max_size to 0 (to disable the limit) --- lib/validator/sfValidatorSchema.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/validator/sfValidatorSchema.class.php b/lib/validator/sfValidatorSchema.class.php index d91508864..097aeffe5 100644 --- a/lib/validator/sfValidatorSchema.class.php +++ b/lib/validator/sfValidatorSchema.class.php @@ -110,7 +110,7 @@ protected function doClean($values) $errorSchema = new sfValidatorErrorSchema($this); // check that post_max_size has not been reached - if (isset($_SERVER['CONTENT_LENGTH']) && (int) $_SERVER['CONTENT_LENGTH'] > $this->getBytes(ini_get('post_max_size'))) + if (isset($_SERVER['CONTENT_LENGTH']) && (int) $_SERVER['CONTENT_LENGTH'] > $this->getBytes(ini_get('post_max_size')) && ini_get('post_max_size') != 0) { $errorSchema->addError(new sfValidatorError($this, 'post_max_size'));