Fixed #9299: Use correct SVG MIME type for uploads (#9300)

The correct MIME type of SVG is image/svg+xml. Out of an abundance of
caution, I am leaving in image/svg to avoid potentially causing issues
on very old browsers, but this can likely be removed without issue.
This commit is contained in:
Eli Young 2021-03-15 16:42:11 -07:00 committed by GitHub
parent c7626f8387
commit 97fa9663b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,7 @@
<label class="btn btn-default" aria-hidden="true"> <label class="btn btn-default" aria-hidden="true">
{{ trans('button.select_file') }} {{ trans('button.select_file') }}
<input type="file" name="{{ (isset($fieldname) ? $fieldname : 'image') }}" class="js-uploadFile" id="uploadFile" data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}" accept="image/gif,image/jpeg,image/webp,image/png,image/svg" style="display:none; max-width: 90%" aria-label="image" aria-hidden="true"> <input type="file" name="{{ (isset($fieldname) ? $fieldname : 'image') }}" class="js-uploadFile" id="uploadFile" data-maxsize="{{ \App\Helpers\Helper::file_upload_max_size() }}" accept="image/gif,image/jpeg,image/webp,image/png,image/svg,image/svg+xml" style="display:none; max-width: 90%" aria-label="image" aria-hidden="true">
</label> </label>
<span class='label label-default' id="uploadFile-info"></span> <span class='label label-default' id="uploadFile-info"></span>

View file

@ -35,7 +35,7 @@
{{ trans('button.select_file') }} {{ trans('button.select_file') }}
<input type="file" name="{{ $logoVariable }}" class="js-uploadFile" id="{{ $logoId }}" <input type="file" name="{{ $logoVariable }}" class="js-uploadFile" id="{{ $logoId }}"
data-maxsize="{{ $maxSize ?? \App\Helpers\Helper::file_upload_max_size() }}" data-maxsize="{{ $maxSize ?? \App\Helpers\Helper::file_upload_max_size() }}"
accept="{{ $allowedTypes ?? 'image/gif,image/jpeg,image/png,image/svg'}}" style="display:none; max-width: 90%"> accept="{{ $allowedTypes ?? 'image/gif,image/jpeg,image/png,image/svg,image/svg+xml'}}" style="display:none; max-width: 90%">
</label> </label>
<span class='label label-default' id="{{ $logoId }}-info"></span> <span class='label label-default' id="{{ $logoId }}-info"></span>

View file

@ -105,7 +105,7 @@
"logoLabel" => trans('admin/settings/general.favicon'), "logoLabel" => trans('admin/settings/general.favicon'),
"logoClearVariable" => "clear_favicon", "logoClearVariable" => "clear_favicon",
"helpBlock" => trans('admin/settings/general.favicon_size') .' '. trans('admin/settings/general.favicon_format'), "helpBlock" => trans('admin/settings/general.favicon_size') .' '. trans('admin/settings/general.favicon_format'),
"allowedTypes" => "image/x-icon,image/gif,image/jpeg,image/png,image/svg,image/vnd.microsoft.icon", "allowedTypes" => "image/x-icon,image/gif,image/jpeg,image/png,image/svg,image/svg+xml,image/vnd.microsoft.icon",
"maxSize" => 20000 "maxSize" => 20000
]) ])