mirror of
https://github.com/glitch-soc/mastodon.git
synced 2024-11-30 03:50:13 -05:00
Change emoji shortcode validation to allow i18n non-ASCII characters
This commit is contained in:
parent
545c0041a0
commit
422dde31ba
@ -27,7 +27,7 @@ class CustomEmoji < ApplicationRecord
|
|||||||
LOCAL_LIMIT = (ENV['MAX_EMOJI_SIZE'] || 256.kilobytes).to_i
|
LOCAL_LIMIT = (ENV['MAX_EMOJI_SIZE'] || 256.kilobytes).to_i
|
||||||
LIMIT = [LOCAL_LIMIT, (ENV['MAX_REMOTE_EMOJI_SIZE'] || 256.kilobytes).to_i].max
|
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|^)
|
SCAN_RE = /(?<=[^[:alnum:]:]|\n|^)
|
||||||
:(#{SHORTCODE_RE_FRAGMENT}):
|
:(#{SHORTCODE_RE_FRAGMENT}):
|
||||||
|
Loading…
Reference in New Issue
Block a user