Strip HTML in and allow emoji in summaries.
authorscarlett <nia@netbsd.org>
Sat, 5 Jan 2019 17:28:47 +0000 (17:28 +0000)
committerscarlett <nia@netbsd.org>
Sat, 5 Jan 2019 17:28:47 +0000 (17:28 +0000)
lib/pleroma/web/common_api/common_api.ex
lib/pleroma/web/twitter_api/views/activity_view.ex

index e474653ff3208b4ebf1ae5f2fb9ffdd7bc9258e5..a20b854df71da09b1c8135e71cc49651818a8b6b 100644 (file)
@@ -124,7 +124,7 @@ defmodule Pleroma.Web.CommonAPI do
            Map.put(
              object,
              "emoji",
-             Formatter.get_emoji(status)
+             Formatter.get_emoji(status) ++ Formatter.get_emoji(data["spoiler_text"])
              |> Enum.reduce(%{}, fn {name, file}, acc ->
                Map.put(acc, name, "#{Pleroma.Web.Endpoint.static_url()}#{file}")
              end)
index 84f35ebf95f380240e870172f77735bb97363280..9ba347d128b37cde89602e645bea9a5f0f6857ed 100644 (file)
@@ -285,7 +285,7 @@ defmodule Pleroma.Web.TwitterAPI.ActivityView do
       "activity_type" => "post",
       "possibly_sensitive" => possibly_sensitive,
       "visibility" => Pleroma.Web.MastodonAPI.StatusView.get_visibility(object),
-      "summary" => summary
+      "summary" => HTML.strip_tags(summary) |> Formatter.emojify(object["emoji"])
     }
   end