Allow WebP and Gif pics

svg stays forbidden until we can be sure it's fine security-wise

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2019-10-21 13:43:06 +02:00
parent 74c12d6736
commit 25e25d5537
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ import { Component, Model, Prop, Vue, Watch } from 'vue-property-decorator';
@Component @Component
export default class PictureUpload extends Vue { export default class PictureUpload extends Vue {
@Model('change', { type: File }) readonly pictureFile!: File; @Model('change', { type: File }) readonly pictureFile!: File;
@Prop({ type: String, required: false, default: 'image/png,image/jpeg' }) accept; @Prop({ type: String, required: false, default: 'image/gif,image/png,image/jpeg,image/webp' }) accept;
// @ts-ignore // @ts-ignore
@Prop({ type: String, required: false, default() { return this.$t('Avatar'); } }) textFallback!: string; @Prop({ type: String, required: false, default() { return this.$t('Avatar'); } }) textFallback!: string;

View File

@ -166,7 +166,7 @@ defmodule MobilizonWeb.Upload do
defp check_file_size(_, _), do: :ok defp check_file_size(_, _), do: :ok
@picture_content_types ["image/png", "image/jpg", "image/jpeg", "image/webp"] @picture_content_types ["image/gif", "image/png", "image/jpg", "image/jpeg", "image/webp"]
# Return whether the upload is a picture or not # Return whether the upload is a picture or not
defp get_type(content_type) do defp get_type(content_type) do
if content_type in @picture_content_types do if content_type in @picture_content_types do