From fc1a41810683cc8d1c197d0175a4548e6e3e3c16 Mon Sep 17 00:00:00 2001 From: Iltar van der Berg Date: Thu, 1 Jun 2017 15:08:01 +0200 Subject: [PATCH] Fixed post_max_size integer issue --- lib/validator/sfValidatorSchema.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/validator/sfValidatorSchema.class.php b/lib/validator/sfValidatorSchema.class.php index 124e553f00..02e619d8e1 100644 --- a/lib/validator/sfValidatorSchema.class.php +++ b/lib/validator/sfValidatorSchema.class.php @@ -375,17 +375,18 @@ public function __clone() protected function getBytes($value) { $value = trim($value); + $size = (int) $value; switch (strtolower($value[strlen($value) - 1])) { // The 'G' modifier is available since PHP 5.1.0 case 'g': - $value *= 1024; + $size *= 1024; case 'm': - $value *= 1024; + $size *= 1024; case 'k': - $value *= 1024; + $size *= 1024; } - return $value; + return $size; } }