diff --git a/Changelog.md b/Changelog.md index c7b9d4c1a..5ae3c3589 100644 --- a/Changelog.md +++ b/Changelog.md @@ -25,6 +25,7 @@ Although the chat was never enabled per default and was marked as experimental, ## Bug fixes * Fix multiple photos upload progress bar [#7655](https://github.com/diaspora/diaspora/pull/7655) +* Photo-upload file picker now correctly restricts possible file types [#8205](https://github.com/diaspora/diaspora/pull/8205) ## Features * Add client-side cropping of profile image uploads [#7581](https://github.com/diaspora/diaspora/pull/7581) diff --git a/app/assets/javascripts/helpers/post_photo_uploader.es6 b/app/assets/javascripts/helpers/post_photo_uploader.es6 index 10a6f6b24..581a41f31 100644 --- a/app/assets/javascripts/helpers/post_photo_uploader.es6 +++ b/app/assets/javascripts/helpers/post_photo_uploader.es6 @@ -54,6 +54,7 @@ Diaspora.PostPhotoUploader = class { } }, validation: { + acceptFiles: "image/png, image/jpeg, image/gif", allowedExtensions: ["jpg", "jpeg", "png", "gif"], sizeLimit: (window.Promise && qq.supportedFeatures.scaling ? null : this.sizeLimit) }, diff --git a/app/assets/javascripts/helpers/profile_photo_uploader.es6 b/app/assets/javascripts/helpers/profile_photo_uploader.es6 index 5524adf2b..6dc3c205b 100644 --- a/app/assets/javascripts/helpers/profile_photo_uploader.es6 +++ b/app/assets/javascripts/helpers/profile_photo_uploader.es6 @@ -38,6 +38,7 @@ Diaspora.ProfilePhotoUploader = class { this.fineUploader = new qq.FineUploaderBasic({ element: this.fileInput, validation: { + acceptFiles: "image/png, image/jpeg", allowedExtensions: ["jpg", "jpeg", "png"] }, request: { diff --git a/app/assets/javascripts/mobile/mobile_profile_photo_uploader.js b/app/assets/javascripts/mobile/mobile_profile_photo_uploader.js index 059622cea..cc70ba1c1 100644 --- a/app/assets/javascripts/mobile/mobile_profile_photo_uploader.js +++ b/app/assets/javascripts/mobile/mobile_profile_photo_uploader.js @@ -11,6 +11,7 @@ Diaspora.ProfilePhotoUploader.prototype = { new qq.FineUploaderBasic({ element: document.getElementById("file-upload"), validation: { + acceptFiles: "image/png, image/jpeg, image/gif", allowedExtensions: ["jpg", "jpeg", "png"], sizeLimit: 4194304 },