FIX: Composer upload icon regression because of HEIC
Now that HEIC conversion is enabled by default we need to update a few file extension checks to include `heic` and heif` formats. https://meta.discourse.org/t/-/144326/23?u=blake bug reported here: https://meta.discourse.org/t/-/161197?u=blake
This commit is contained in:
parent
38e7b1a049
commit
ba9fbb3443
|
@ -56,7 +56,7 @@ export default Controller.extend(ModalFunctionality, {
|
||||||
const imageUrl = this.imageUrl || "";
|
const imageUrl = this.imageUrl || "";
|
||||||
const toolbarEvent = this.toolbarEvent;
|
const toolbarEvent = this.toolbarEvent;
|
||||||
|
|
||||||
if (imageUrl.match(/\.(jpg|jpeg|png|gif)$/)) {
|
if (imageUrl.match(/\.(jpg|jpeg|png|gif|heic|heif)$/)) {
|
||||||
toolbarEvent.addText(`![](${imageUrl})`);
|
toolbarEvent.addText(`![](${imageUrl})`);
|
||||||
} else {
|
} else {
|
||||||
toolbarEvent.addText(imageUrl);
|
toolbarEvent.addText(imageUrl);
|
||||||
|
|
|
@ -113,7 +113,7 @@ function validateUploadedFile(file, opts) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const IMAGES_EXTENSIONS_REGEX = /(png|jpe?g|gif|svg|ico)/i;
|
const IMAGES_EXTENSIONS_REGEX = /(png|jpe?g|gif|svg|ico|heic|heif)/i;
|
||||||
|
|
||||||
function extensionsToArray(exts) {
|
function extensionsToArray(exts) {
|
||||||
return exts
|
return exts
|
||||||
|
@ -177,7 +177,7 @@ export function authorizedExtensions(staff, siteSettings) {
|
||||||
|
|
||||||
function authorizedImagesExtensions(staff, siteSettings) {
|
function authorizedImagesExtensions(staff, siteSettings) {
|
||||||
return authorizesAllExtensions(staff, siteSettings)
|
return authorizesAllExtensions(staff, siteSettings)
|
||||||
? "png, jpg, jpeg, gif, svg, ico"
|
? "png, jpg, jpeg, gif, svg, ico, heic, heif"
|
||||||
: imagesExtensions(staff, siteSettings).join(", ");
|
: imagesExtensions(staff, siteSettings).join(", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue