mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 03:51:07 +08:00
DEV: Add Custom emoji sanitization (#22697)
* DEV: Add Custom emoji sanitization * added tests for implemented changes
This commit is contained in:

committed by
GitHub

parent
9650bf9d08
commit
9e83d64723
@ -684,6 +684,7 @@ class Plugin::Instance
|
||||
end
|
||||
|
||||
def register_emoji(name, url, group = Emoji::DEFAULT_GROUP)
|
||||
name = name.gsub(/[^a-z0-9]+/i, "_").gsub(/_{2,}/, "_").downcase
|
||||
Plugin::CustomEmoji.register(name, url, group)
|
||||
Emoji.clear_cache
|
||||
end
|
||||
|
Reference in New Issue
Block a user