Revert to previous tag_validator behavior

This paritally reverts commit 9710063fdc
and reverts commit 7ddae61414

See thread: https://git.pleroma.social/pleroma/pleroma/-/merge_requests/4358#note_112761
This commit is contained in:
Phantasm 2025-06-04 18:32:25 +02:00
commit dc26f74961
No known key found for this signature in database
GPG key ID: 2669E588BCC634C8
2 changed files with 2 additions and 8 deletions

View file

@ -50,13 +50,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.TagValidator do
end
def changeset(struct, %{"type" => "Hashtag", "name" => name} = data) do
name =
case name do
"#" <> name -> name
name -> name
end
|> String.downcase()
name = String.downcase(name)
data = Map.put(data, "name", name)
struct

View file

@ -200,7 +200,7 @@ defmodule Pleroma.Web.ActivityPub.Transmogrifier.NoteHandlingTest do
assert match?(
%{
"href" => "http://mastodon.example.org/tags/moo",
"name" => "moo",
"name" => "#moo",
"type" => "Hashtag"
},
Enum.at(object.data["tag"], 1)