diff options
author | silverpill <silverpill@firemail.cc> | 2022-12-30 17:26:43 +0000 |
---|---|---|
committer | silverpill <silverpill@firemail.cc> | 2023-02-27 23:09:46 +0000 |
commit | 5cfb0578a6845db377b5679ac05aa25ee5656211 (patch) | |
tree | a5940d3aabd1c8f02d886c63ef76e85b116381aa /lib | |
parent | 45646ff52cd045485c6be92713edcd0b37225bc3 (diff) | |
download | pleroma-5cfb0578a6845db377b5679ac05aa25ee5656211.tar.gz pleroma-5cfb0578a6845db377b5679ac05aa25ee5656211.zip |
TagValidator: Drop unrecognized tags
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pleroma/web/activity_pub/object_validators/tag_validator.ex | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/pleroma/web/activity_pub/object_validators/tag_validator.ex b/lib/pleroma/web/activity_pub/object_validators/tag_validator.ex index ad968994e..cfd510c19 100644 --- a/lib/pleroma/web/activity_pub/object_validators/tag_validator.ex +++ b/lib/pleroma/web/activity_pub/object_validators/tag_validator.ex @@ -68,8 +68,11 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.TagValidator do |> validate_required([:type, :name, :icon]) end - # Fallback - def changeset(struct, data), do: cast(struct, data, [:type, :name]) + def changeset(struct, %{"type" => _} = data) do + struct + |> cast(data, []) + |> Map.put(:action, :ignore) + end def icon_changeset(struct, data) do struct |