Skip to content

Commit

Permalink
Fixed post_max_size integer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Iltar van der Berg committed Jun 1, 2017
1 parent 1b22e7c commit fc1a418
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/validator/sfValidatorSchema.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit fc1a418

Please sign in to comment.