HTML-sanitize usernames before emojifying.
authoreal <eal@waifu.club>
Thu, 9 Aug 2018 10:07:03 +0000 (13:07 +0300)
committereal <eal@waifu.club>
Thu, 9 Aug 2018 10:07:03 +0000 (13:07 +0300)
lib/pleroma/web/twitter_api/views/user_view.ex

index 30aaaf1ceb87f90630363c00bfd78b18d9162bf2..7d0f0e7039c9df5d0b77c35e463559615b440181 100644 (file)
@@ -50,7 +50,7 @@ defmodule Pleroma.Web.TwitterAPI.UserView do
       "friends_count" => user_info[:following_count],
       "id" => user.id,
       "name" => user.name,
-      "name_html" => Formatter.emojify(user.name, emoji),
+      "name_html" => HtmlSanitizeEx.strip_tags(user.name) |> Formatter.emojify(emoji),
       "profile_image_url" => image,
       "profile_image_url_https" => image,
       "profile_image_url_profile_size" => image,