summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
authorHiramiya <Hiramiya@users.noreply.github.com>2018-08-27 20:03:48 +0100
committerGitHub <noreply@github.com>2018-08-27 20:03:48 +0100
commite7e6d833b7039957cc58bdf0b673156a65f3cc92 (patch)
tree904d580f49a501740115ddc121e4a1c3c72b34d5 /src/client
parentRestrict avatar filetypes (diff)
downloadmisskey-e7e6d833b7039957cc58bdf0b673156a65f3cc92.tar.gz
misskey-e7e6d833b7039957cc58bdf0b673156a65f3cc92.tar.bz2
misskey-e7e6d833b7039957cc58bdf0b673156a65f3cc92.zip
Restrict banner filetypes
Diffstat (limited to 'src/client')
-rw-r--r--src/client/app/desktop/api/update-banner.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/client/app/desktop/api/update-banner.ts b/src/client/app/desktop/api/update-banner.ts
index 33c4e306a2..5af6ea88d2 100644
--- a/src/client/app/desktop/api/update-banner.ts
+++ b/src/client/app/desktop/api/update-banner.ts
@@ -6,6 +6,20 @@ import ProgressDialog from '../views/components/progress-dialog.vue';
export default (os: OS) => {
const cropImage = file => new Promise((resolve, reject) => {
+
+ var regex = RegExp('\.(jpg|jpeg|png|gif|webp|bmp|tiff)$')
+
+ if(!regex.test(file.name) ) {
+ os.apis.dialog({
+ title: '%fa:info-circle% %i18n:desktop.invalid-filetype%',
+ text: null,
+ actions: [{
+ text: '%i18n:common.got-it%'
+ }]
+ });
+ reject
+ }
+
const w = os.new(CropWindow, {
image: file,
title: '%i18n:desktop.banner-crop-title%',