Merge branch 'patch-5' into 'develop'
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>
Wed, 11 Sep 2019 17:47:19 +0000 (17:47 +0000)
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>
Wed, 11 Sep 2019 17:47:19 +0000 (17:47 +0000)
Mastodon API: URI encode hashtag name in generated URLs

See merge request pleroma/pleroma!1642

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

index b6a3431f9654fde799b7e9279ca2a51acb46b4d5..ef796cddd2b0645d46293a2b1f4ea70537bb89fb 100644 (file)
@@ -497,7 +497,7 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
     object_tags = for tag when is_binary(tag) <- object_tags, do: tag
 
     Enum.reduce(object_tags, [], fn tag, tags ->
-      tags ++ [%{name: tag, url: "/tag/#{tag}"}]
+      tags ++ [%{name: tag, url: "/tag/#{URI.encode(tag)}"}]
     end)
   end