projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c45013d
)
Mastodon API: URI encode hashtag name in generated URLs
author
shadowfacts
<me@shadowfacts.net>
Sat, 7 Sep 2019 19:50:45 +0000
(19:50 +0000)
committer
shadowfacts
<me@shadowfacts.net>
Sat, 7 Sep 2019 19:50:45 +0000
(19:50 +0000)
Otherwise hashtags with word characters other than those allowed in URLs (e.g. Japanese characters) produce hashtag URLs that are invalid.
lib/pleroma/web/mastodon_api/views/status_view.ex
patch
|
blob
|
history
diff --git
a/lib/pleroma/web/mastodon_api/views/status_view.ex
b/lib/pleroma/web/mastodon_api/views/status_view.ex
index e71083b918ffca8d2c21b5dcc81565f4605376e9..708b8c2fd2c5af2c0af6e944b4a89be6974ac9cb 100644
(file)
--- 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