Loosen the validation regex of emoji reaction a bit #468

Closed
Ghost wants to merge 1 commit from (deleted):make-reacting-with-'blobhaj.png'-possible into develop
Showing only changes of commit 33daaac84c - Show all commits

Loosen the validation regex of emoji reaction a bit
Some checks are pending
ci/woodpecker/pr/woodpecker Pipeline is pending

We couldn't previously react with an emoji whose shortcode contained
dots, spaces or any non-ascii characters.

The only rule we're now enforcing is that it might contain only one `@`
character (used to distinguish external emoji) and must be wrapped with
colon symbols.
fruye 2023-02-15 20:12:01 +01:00

View file

@ -13,7 +13,7 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.EmojiReactValidator do
import Pleroma.Web.ActivityPub.ObjectValidators.CommonValidations
@primary_key false
@emoji_regex ~r/:[A-Za-z0-9_-]+(@.+)?:/
@emoji_regex ~r/^:[^@]+(@[^@]+)?:$/
embedded_schema do
quote do