Add support for AVIF logo uploads and restoring avifs from public uploads
Extended the list of allowed file extensions and MIME types to include AVIF format in both backend file validation and the file input field for logo uploads. This update ensures compatibility with modern image formats.
This commit is contained in:
parent
cbf4fef45b
commit
cd9ee8af90
2 changed files with 5 additions and 2 deletions
|
@ -329,7 +329,8 @@ class RestoreFromBackup extends Command
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$good_extensions = ['png', 'gif', 'jpg', 'svg', 'jpeg', 'doc', 'docx', 'pdf', 'txt',
|
$good_extensions = ['png', 'gif', 'jpg', 'svg', 'jpeg', 'doc', 'docx', 'pdf', 'txt',
|
||||||
'zip', 'rar', 'xls', 'xlsx', 'lic', 'xml', 'rtf', 'webp', 'key', 'ico',];
|
'zip', 'rar', 'xls', 'xlsx', 'lic', 'xml', 'rtf', 'webp', 'key', 'ico', 'avif'
|
||||||
|
];
|
||||||
foreach (array_merge($private_files, $public_files) as $file) {
|
foreach (array_merge($private_files, $public_files) as $file) {
|
||||||
$has_wildcard = (strpos($file, '*') !== false);
|
$has_wildcard = (strpos($file, '*') !== false);
|
||||||
if ($has_wildcard) {
|
if ($has_wildcard) {
|
||||||
|
|
|
@ -9,7 +9,9 @@
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<label class="btn btn-default{{ (config('app.lock_passwords')) ? ' disabled' : '' }}">
|
<label class="btn btn-default{{ (config('app.lock_passwords')) ? ' disabled' : '' }}">
|
||||||
{{ trans('button.select_file') }}
|
{{ trans('button.select_file') }}
|
||||||
<input type="file" name="{{ $logoVariable }}" class="js-uploadFile" id="{{ $logoId }}" accept="{{ $allowedTypes ?? "image/gif,image/jpeg,image/webp,image/png,image/svg,image/svg+xml" }}" data-maxsize="{{ $maxSize ?? Helper::file_upload_max_size() }}"
|
<input type="file" name="{{ $logoVariable }}" class="js-uploadFile" id="{{ $logoId }}"
|
||||||
|
accept="{{ $allowedTypes ?? "image/gif,image/jpeg,image/webp,image/png,image/svg,image/svg+xml,image/avif" }}"
|
||||||
|
data-maxsize="{{ $maxSize ?? Helper::file_upload_max_size() }}"
|
||||||
style="display:none; max-width: 90%"{{ (config('app.lock_passwords')) ? ' disabled' : '' }}>
|
style="display:none; max-width: 90%"{{ (config('app.lock_passwords')) ? ' disabled' : '' }}>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue