Skip to content

Commit c348096

Browse files
authored
Merge pull request #5 from netgen/fix_file_validator_M_suffix
maxSize uses value in MB
2 parents 0cf1646 + 2a070aa commit c348096

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bundle/Form/FieldTypeHandler/EnhancedFile.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ protected function buildFieldForm(
7171
if (false !== $maxFileSize || !empty($allowedExtensions)) {
7272
$constraints = array();
7373

74-
if (false !== $maxFileSize) {
75-
$constraints['maxSize'] = $maxFileSize;
74+
if (false !== $maxFileSize && !empty($maxFileSize)) {
75+
$constraints['maxSize'] = strval($maxFileSize) . "M";
7676
}
7777

7878
if (!empty($allowedExtensions)) {

0 commit comments

Comments
 (0)