diff options
author | shadowfacts <me@shadowfacts.net> | 2019-09-07 19:50:45 +0000 |
---|---|---|
committer | shadowfacts <me@shadowfacts.net> | 2019-09-07 19:50:45 +0000 |
commit | e5c6bf3673a8361d1417eba1ccc44edec7658ac4 (patch) | |
tree | 623c2159a52c87482ea333133e32926aa42a8097 | |
parent | c45013df8e53334bcc1afb8cd1df673c290037ee (diff) | |
download | pleroma-e5c6bf3673a8361d1417eba1ccc44edec7658ac4.tar.gz |
Mastodon API: URI encode hashtag name in generated URLs
Otherwise hashtags with word characters other than those allowed in URLs (e.g. Japanese characters) produce hashtag URLs that are invalid.
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/status_view.ex | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pleroma/web/mastodon_api/views/status_view.ex b/lib/pleroma/web/mastodon_api/views/status_view.ex index e71083b91..708b8c2fd 100644 --- a/lib/pleroma/web/mastodon_api/views/status_view.ex +++ b/lib/pleroma/web/mastodon_api/views/status_view.ex @@ -499,7 +499,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 |