masto api: run emojis through mediaproxy
authorMorgan Bazalgette <the@howl.moe>
Mon, 2 Apr 2018 10:04:11 +0000 (12:04 +0200)
committerMorgan Bazalgette <the@howl.moe>
Mon, 2 Apr 2018 10:04:11 +0000 (12:04 +0200)
fixes #107

lib/pleroma/web/mastodon_api/views/status_view.ex

index bc5ae5da7dd80212d827096ceacd1f5a6ff20ed2..df360644a515a3c71bcf64aa760f76335595e14a 100644 (file)
@@ -125,7 +125,11 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       (activity.data["object"]["emoji"] || [])
       |> Enum.map(fn {name, url} ->
         name = HtmlSanitizeEx.strip_tags(name)
-        url = HtmlSanitizeEx.strip_tags(url)
+
+        url =
+          HtmlSanitizeEx.strip_tags(url)
+          |> MediaProxy.url()
+
         %{shortcode: name, url: url, static_url: url}
       end)