diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2024-01-05 00:45:29 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2024-01-05 00:45:29 +0000 |
commit | 67a5542a73a8fab8c79da21022877bc233e8a760 (patch) | |
tree | d988a34365b2e899e69a962583581abfe6d3e41e | |
parent | f74f5e0a56277507e7bc3df7251ec58b6c8b41cb (diff) | |
parent | 32d8e0d496265f2ebe15199bede63a1f57f043cd (diff) | |
download | pleroma-67a5542a73a8fab8c79da21022877bc233e8a760.tar.gz pleroma-67a5542a73a8fab8c79da21022877bc233e8a760.zip |
Merge branch 'fix-account-auth-check' into 'develop'
Fix authentication check on account rendering when bio is defined
See merge request pleroma/pleroma!4027
-rw-r--r-- | changelog.d/account-rendering-auth-check.fix | 1 | ||||
-rw-r--r-- | lib/pleroma/web/mastodon_api/views/account_view.ex | 6 |
2 files changed, 5 insertions, 2 deletions
diff --git a/changelog.d/account-rendering-auth-check.fix b/changelog.d/account-rendering-auth-check.fix new file mode 100644 index 000000000..12f68e454 --- /dev/null +++ b/changelog.d/account-rendering-auth-check.fix @@ -0,0 +1 @@ +Fix authentication check on account rendering when bio is defined diff --git a/lib/pleroma/web/mastodon_api/views/account_view.ex b/lib/pleroma/web/mastodon_api/views/account_view.ex index e7c555eb2..df8fdc8b8 100644 --- a/lib/pleroma/web/mastodon_api/views/account_view.ex +++ b/lib/pleroma/web/mastodon_api/views/account_view.ex @@ -194,6 +194,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do end defp do_render("show.json", %{user: user} = opts) do + self = opts[:for] == user + user = User.sanitize_html(user, User.html_filter_policy(opts[:for])) display_name = user.name || user.nickname @@ -203,12 +205,12 @@ defmodule Pleroma.Web.MastodonAPI.AccountView do header_static = User.banner_url(user) |> MediaProxy.preview_url(static: true) following_count = - if !user.hide_follows_count or !user.hide_follows or opts[:for] == user, + if !user.hide_follows_count or !user.hide_follows or self, do: user.following_count, else: 0 followers_count = - if !user.hide_followers_count or !user.hide_followers or opts[:for] == user, + if !user.hide_followers_count or !user.hide_followers or self, do: user.follower_count, else: 0 |