From 33daaac84cc7ffec2dcecfc17df026618929312d Mon Sep 17 00:00:00 2001 From: fruye Date: Wed, 15 Feb 2023 20:12:01 +0100 Subject: [PATCH] Loosen the validation regex of emoji reaction a bit 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. --- .../web/activity_pub/object_validators/emoji_react_validator.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex b/lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex index 6109a0355..8cf0df247 100644 --- a/lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex +++ b/lib/pleroma/web/activity_pub/object_validators/emoji_react_validator.ex @@ -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