mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06: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
@@ -589,6 +589,14 @@ RSpec.describe Plugin::Instance do
|
||||
expect(custom_emoji.url).to eq("/baz/bar.png")
|
||||
expect(custom_emoji.group).to eq("baz")
|
||||
end
|
||||
|
||||
it "sanitizes emojis' names" do
|
||||
Plugin::Instance.new.register_emoji("?", "/baz/bar.png", "baz")
|
||||
Plugin::Instance.new.register_emoji("?test?!!", "/foo/bar.png", "baz")
|
||||
|
||||
expect(Emoji.custom.first.name).to eq("_")
|
||||
expect(Emoji.custom.second.name).to eq("_test_")
|
||||
end
|
||||
end
|
||||
|
||||
describe "#replace_flags" do
|
||||
|
||||
Reference in New Issue
Block a user