From: rinpatch Date: Sat, 2 Feb 2019 08:53:46 +0000 (+0300) Subject: merge only if page_url is an absolute path X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=e4d18f328b738a2c3a953e721f0d350cfba20089;p=akkoma merge only if page_url is an absolute path --- diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index 826563f74..aa38784a6 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -186,8 +186,12 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do page_url_data = URI.parse(page_url) image_url = - URI.merge(page_url_data, URI.parse(rich_media[:image])) - |> to_string + if %URI{host: nil} = page_url_data do + rich_media[:image] + else + URI.merge(page_url_data, URI.parse(rich_media[:image])) + |> to_string + end site_name = rich_media[:site_name] || page_url_data.host