FIX: Composer upload icon regression because of WEBP (#11959)

Similar to
ba9fbb3443

Reported on
https://meta.discourse.org/t/image-icon-has-changed-to-upload-icon/178247?u=falco
This commit is contained in:
Rafael dos Santos Silva 2021-02-04 00:41:07 -03:00 committed by GitHub
parent e7ca1ed6bf
commit d518b302a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -56,7 +56,7 @@ export default Controller.extend(ModalFunctionality, {
const imageUrl = this.imageUrl || "";
const toolbarEvent = this.toolbarEvent;
if (imageUrl.match(/\.(jpg|jpeg|png|gif|heic|heif)$/)) {
if (imageUrl.match(/\.(jpg|jpeg|png|gif|heic|heif|webp)$/)) {
toolbarEvent.addText(`![](${imageUrl})`);
} else {
toolbarEvent.addText(imageUrl);

View File

@ -118,7 +118,7 @@ function validateUploadedFile(file, opts) {
return true;
}
const IMAGES_EXTENSIONS_REGEX = /(png|jpe?g|gif|svg|ico|heic|heif)/i;
const IMAGES_EXTENSIONS_REGEX = /(png|jpe?g|gif|svg|ico|heic|heif|webp)/i;
function extensionsToArray(exts) {
return exts
@ -182,7 +182,7 @@ export function authorizedExtensions(staff, siteSettings) {
function authorizedImagesExtensions(staff, siteSettings) {
return authorizesAllExtensions(staff, siteSettings)
? "png, jpg, jpeg, gif, svg, ico, heic, heif"
? "png, jpg, jpeg, gif, svg, ico, heic, heif, webp"
: imagesExtensions(staff, siteSettings).join(", ");
}