FIX: prevent cross-contamination of emojis in multisites
This commit is contained in:
parent
5e3da94c46
commit
7fbf902d09
|
@ -12,6 +12,11 @@ Discourse.Dialect.registerEmoji = function(code, url) {
|
|||
extendedEmoji[code] = url;
|
||||
};
|
||||
|
||||
// This method is used by PrettyText to reset custom emojis in multisites
|
||||
Discourse.Dialect.resetEmoji = function() {
|
||||
extendedEmoji = {};
|
||||
};
|
||||
|
||||
Discourse.Emoji.list = function(){
|
||||
var list = emoji.slice(0);
|
||||
_.each(extendedEmoji, function(v,k){ list.push(k); });
|
||||
|
|
|
@ -189,6 +189,8 @@ module PrettyText
|
|||
end
|
||||
end
|
||||
|
||||
# reset emojis (v8 context is shared amongst multisites)
|
||||
context.eval("Discourse.Dialect.resetEmoji();")
|
||||
# custom emojis
|
||||
Emoji.custom.each do |emoji|
|
||||
context.eval("Discourse.Dialect.registerEmoji('#{emoji.name}', '#{emoji.url}');")
|
||||
|
|
Loading…
Reference in New Issue