From: Claire Date: Mon, 14 Nov 2022 23:32:59 +0000 (+0100) Subject: Fix infinite loop when system emoji font is enabled (#1931) X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=9983797cad6b32188c2a41a2b5404dc043697abe;p=mastodon.git Fix infinite loop when system emoji font is enabled (#1931) Fixes #1930 --- diff --git a/app/javascript/flavours/glitch/util/emoji/index.js b/app/javascript/flavours/glitch/util/emoji/index.js index 6b7de213c..251db1d5b 100644 --- a/app/javascript/flavours/glitch/util/emoji/index.js +++ b/app/javascript/flavours/glitch/util/emoji/index.js @@ -30,11 +30,11 @@ const emojifyTextNode = (node, customEmojis) => { let match, i = 0; if (customEmojis === null) { - while (i < str.length && !(match = trie.search(str.slice(i)))) { + while (i < str.length && (useSystemEmojiFont || !(match = trie.search(str.slice(i))))) { i += str.codePointAt(i) < 65536 ? 1 : 2; } } else { - while (i < str.length && str[i] !== ':' && !(match = trie.search(str.slice(i)))) { + while (i < str.length && str[i] !== ':' && (useSystemEmojiFont || !(match = trie.search(str.slice(i))))) { i += str.codePointAt(i) < 65536 ? 1 : 2; } }