Skip to content

Commit

Permalink
Fix infinite loop when system emoji font is enabled (glitch-soc#1931)
Browse files Browse the repository at this point in the history
  • Loading branch information
ClearlyClaire committed Nov 14, 2022
1 parent e589afa commit ceafd1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/javascript/flavours/glitch/features/emoji/emoji.js
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit ceafd1f

Please sign in to comment.