We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 911a5a0 commit 1a27b4aCopy full SHA for 1a27b4a
src/Traits/Attachments.php
@@ -267,8 +267,11 @@ protected function saveAttachments($info)
267
}
268
$attachment->original_filename = $original_filename;
269
270
+ // Mimes validation rule
271
+ $file_rules = (preg_match('/:/', Setting::grab('attachments_mimes')) ? '' : 'mimes:') . Setting::grab('attachments_mimes');
272
+
273
// Mimetype
- $validator = Validator::make(['file' => $uploadedFile], ['file' => 'mimes:'.Setting::grab('attachments_mimes')]);
274
+ $validator = Validator::make(['file' => $uploadedFile], ['file' => $file_rules]);
275
276
if ($validator->fails()) {
277
$a_errors[$attachment_block_name.($block + $index)] = trans('panichd::lang.attachment-update-not-valid-mime', ['file' => $original_filename]);
0 commit comments