Skip to content

Commit 95955f0

Browse files
committed
Fix error 'A non well formed numeric value' on sfValidatorFile
1 parent d8b44b8 commit 95955f0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/validator/sfValidatorFile.class.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,16 +320,17 @@ protected function getMaxFilesize()
320320
return PHP_INT_MAX;
321321
}
322322

323+
$value = strtolower(substr($max, 0, -1));
323324
switch (strtolower(substr($max, -1)))
324325
{
325326
case 'g':
326-
$max *= 1024;
327+
$value *= 1024;
327328
case 'm':
328-
$max *= 1024;
329+
$value *= 1024;
329330
case 'k':
330-
$max *= 1024;
331+
$value *= 1024;
331332
}
332333

333-
return (integer) $max;
334+
return (integer) $value;
334335
}
335336
}

0 commit comments

Comments
 (0)