TagValidator: Drop unrecognized tags

This commit is contained in:
silverpill 2022-12-30 17:26:43 +00:00
commit 5cfb0578a6
3 changed files with 12 additions and 6 deletions

View file

@ -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