Merge pull request 'StatusView: handle attachments with zero width or height' (#8026) from lambadalambda/pleroma:fix/attachment-zero-size into develop

Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/8026
This commit is contained in:
lain 2026-10-27 15:00:18 +00:00
commit d54ff52691
3 changed files with 20 additions and 1 deletions

View file

@ -675,7 +675,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
def render("attachment_meta.json", %{
attachment: %{"url" => [%{"width" => width, "height" => height} | _]}
})
when is_integer(width) and is_integer(height) do
when is_integer(width) and is_integer(height) and width > 0 and height > 0 do
%{
original: %{
width: width,