From 8ad361cb29b46425e99bfc8edefcada0fe70a62f Mon Sep 17 00:00:00 2001 From: hazycora Date: Sun, 17 Dec 2023 16:42:54 -0600 Subject: [PATCH] allow dashes in emoji shortcodes --- 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 7ea50e85d8..817650170a 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 = '[a-zA-Z0-9_-]{2,}' SCAN_RE = /(?<=[^[:alnum:]:]|\n|^) :(#{SHORTCODE_RE_FRAGMENT}):