diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 91dd9eeec7..3479232252 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -2713,10 +2713,11 @@ def sanitize_html(%User{} = user) do # - display name def sanitize_html(%User{} = user, filter) do fields = - Enum.map(user.fields, fn %{"name" => name, "value" => value} -> + Enum.map(user.fields, fn %{"name" => name, "value" => value} = field -> %{ "name" => name, - "value" => HTML.filter_tags(value, Pleroma.HTML.Scrubber.LinksOnly) + "value" => HTML.filter_tags(value, Pleroma.HTML.Scrubber.LinksOnly), + "verified_at" => Map.get(field, "verified_at") } end) diff --git a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex index f54e0589e0..11ed75bda8 100644 --- a/lib/pleroma/web/mastodon_api/controllers/account_controller.ex +++ b/lib/pleroma/web/mastodon_api/controllers/account_controller.ex @@ -259,7 +259,9 @@ def update_credentials(%{assigns: %{user: user}, body_params: params} = conn, _p defp normalize_fields_attributes(fields) do if Enum.all?(fields, &is_tuple/1) do - Enum.map(fields, fn {_, v} -> v end) + Enum.map(fields, fn {_, %{} = field} -> + %{"name" => field["name"], "value" => field["value"]} + end) else Enum.map(fields, fn %{} = field -> %{"name" => field.name, "value" => field.value}