diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-09-04 17:56:05 -0500 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-09-08 12:29:38 +0300 |
commit | 216c84a8f4d82649110ffaa2bc9d02b879805c5f (patch) | |
tree | 8cc0eee8377ad60bd405f8544a0acea1b8116154 /lib | |
parent | 3a98960c2684229435c5d04e4f3e0611098ceea2 (diff) | |
download | pleroma-216c84a8f4d82649110ffaa2bc9d02b879805c5f.tar.gz |
Bypass the filter based on content-type as well in case a webp image is uploaded with the wrong file extension.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/upload/filter/exiftool.ex | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/pleroma/upload/filter/exiftool.ex b/lib/pleroma/upload/filter/exiftool.ex index 94d12c01b..b07a671ac 100644 --- a/lib/pleroma/upload/filter/exiftool.ex +++ b/lib/pleroma/upload/filter/exiftool.ex @@ -10,8 +10,11 @@ defmodule Pleroma.Upload.Filter.Exiftool do @behaviour Pleroma.Upload.Filter @spec filter(Pleroma.Upload.t()) :: {:ok, any()} | {:error, String.t()} + + # webp is not compatible with exiftool at this time + def filter(%Pleroma.Upload{content_type: "image/webp"}), do: {:ok, :noop} + def filter(%Pleroma.Upload{name: file, tempfile: path, content_type: "image" <> _}) do - # webp is not compatible with exiftool at this time if Regex.match?(~r/\.(webp)$/i, file) do {:ok, :noop} else |