mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: custom emojis leaking over multisite - take 2
This commit is contained in:
@@ -35,7 +35,7 @@ export function performEmojiUnescape(string, opts) {
|
||||
const emojiVal = isEmoticon ? translations[m] : m.slice(1, m.length - 1);
|
||||
const hasEndingColon = m.lastIndexOf(":") === m.length - 1;
|
||||
const url = buildEmojiUrl(emojiVal, opts);
|
||||
const classes = isCustomEmoji(emojiVal) ? "emoji emoji-custom" : "emoji";
|
||||
const classes = isCustomEmoji(emojiVal, opts) ? "emoji emoji-custom" : "emoji";
|
||||
|
||||
return url && (isEmoticon || hasEndingColon) ?
|
||||
`<img src='${url}' title='${emojiVal}' alt='${emojiVal}' class='${classes}'>` : m;
|
||||
@@ -45,8 +45,11 @@ export function performEmojiUnescape(string, opts) {
|
||||
return string;
|
||||
}
|
||||
|
||||
export function isCustomEmoji(code) {
|
||||
return extendedEmoji.hasOwnProperty(code.toLowerCase());
|
||||
export function isCustomEmoji(code, opts) {
|
||||
code = code.toLowerCase();
|
||||
if (extendedEmoji.hasOwnProperty(code)) return true;
|
||||
if (opts && opts.customEmoji && opts.customEmoji.hasOwnProperty(code)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
export function buildEmojiUrl(code, opts) {
|
||||
|
||||
Reference in New Issue
Block a user