end
Enum.reduce(all_emoji, text, fn ({emoji, file}, text) ->
+ emoji = HtmlSanitizeEx.strip_tags(emoji)
+ file = HtmlSanitizeEx.strip_tags(file)
String.replace(text, ":#{emoji}:", "<img height='32px' width='32px' alt='#{emoji}' title='#{emoji}' src='#{MediaProxy.url(file)}' />")
end)
end
reply_to_user = reply_to && User.get_cached_by_ap_id(reply_to.data["actor"])
emojis = (activity.data["object"]["emoji"] || [])
- |> Enum.map(fn {name, url} -> %{ shortcode: name, url: url, static_url: url } end)
+ |> Enum.map(fn {name, url} ->
+ name = HtmlSanitizeEx.strip_tags(name)
+ url = HtmlSanitizeEx.strip_tags(url)
+ %{ shortcode: name, url: url, static_url: url }
+ end)
%{
id: to_string(activity.id),