From 422dde31bab4bc98c856efe11dbf8b61133d1478 Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Sun, 14 Jan 2024 20:53:43 -0600 Subject: [PATCH] Change emoji shortcode validation to allow i18n non-ASCII characters --- app/models/custom_emoji.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/custom_emoji.rb b/app/models/custom_emoji.rb index bd641a8579..1f3c1807ca 100644 --- a/app/models/custom_emoji.rb +++ b/app/models/custom_emoji.rb @@ -27,7 +27,7 @@ class CustomEmoji < ApplicationRecord LOCAL_LIMIT = (ENV['MAX_EMOJI_SIZE'] || 256.kilobytes).to_i LIMIT = [LOCAL_LIMIT, (ENV['MAX_REMOTE_EMOJI_SIZE'] || 256.kilobytes).to_i].max - SHORTCODE_RE_FRAGMENT = '[a-zA-Z0-9_]{2,}' + SHORTCODE_RE_FRAGMENT = '(([[:alnum:]])|_){2,}' SCAN_RE = /(?<=[^[:alnum:]:]|\n|^) :(#{SHORTCODE_RE_FRAGMENT}):