Skip to content

Commit 7a68903

Browse files
committed
config of upload validation should have default value
1 parent 135deb9 commit 7a68903

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/controllers/UploadController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ private function uploadValidator($file)
100100
$file_size = $file->getSize() / 1000;
101101
$type_key = parent::currentLfmType();
102102

103-
if (config('lfm.should_validate_mime')) {
103+
if (config('lfm.should_validate_mime', false)) {
104104
$mine_config = 'lfm.valid_' . $type_key . '_mimetypes';
105105
$valid_mimetypes = config($mine_config, []);
106106
if (false === in_array($mimetype, $valid_mimetypes)) {
107107
return parent::error('mime') . $mimetype;
108108
}
109109
}
110110

111-
if (config('lfm.should_validate_size')) {
111+
if (config('lfm.should_validate_size', false)) {
112112
$max_size = config('lfm.max_' . $type_key . '_size', 0);
113113
if ($file_size > $max_size) {
114114
return parent::error('size') . $mimetype;

0 commit comments

Comments
 (0)