allow dashes in emoji shortcodes

This commit is contained in:
hazycora 2023-12-17 16:42:54 -06:00 committed by Jeremy Kescher
parent fd8b04e9e7
commit 8ad361cb29
No known key found for this signature in database
GPG key ID: 80A419A7A613DFA4

View file

@ -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}):