Merge branch 'mrf-steal-emoji-extname' into 'develop'

MRF.StealEmojiPolicy: Properly add fallback extension to filenames missing one

See merge request pleroma/pleroma!4029
This commit is contained in:
Haelwenn 2024-01-15 08:24:24 +00:00
commit c29430b018
3 changed files with 31 additions and 1 deletions

View file

@ -34,7 +34,9 @@ defmodule Pleroma.Web.ActivityPub.MRF.StealEmojiPolicy do
|> Path.basename()
|> Path.extname()
file_path = Path.join(emoji_dir_path, shortcode <> (extension || ".png"))
extension = if extension == "", do: ".png", else: extension
file_path = Path.join(emoji_dir_path, shortcode <> extension)
case File.write(file_path, response.body) do
:ok ->