Skip to content

Commit

Permalink
Change emoji shortcode validation to allow i18n non-ASCII characters
Browse files Browse the repository at this point in the history
  • Loading branch information
JadedCtrl committed Jan 15, 2024
1 parent 545c004 commit 422dde3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/custom_emoji.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}):
Expand Down

0 comments on commit 422dde3

Please sign in to comment.