diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-20 16:18:24 +0300 |
commit | 0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch) | |
tree | 4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /app/assets/javascripts/emoji | |
parent | 744144d28e3e7fddc117924fef88de5d9674fe4c (diff) |
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
Diffstat (limited to 'app/assets/javascripts/emoji')
-rw-r--r-- | app/assets/javascripts/emoji/index.js | 5 | ||||
-rw-r--r-- | app/assets/javascripts/emoji/support/unicode_support_map.js | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/emoji/index.js b/app/assets/javascripts/emoji/index.js index 7faf0fe5f08..7672151af2a 100644 --- a/app/assets/javascripts/emoji/index.js +++ b/app/assets/javascripts/emoji/index.js @@ -1,5 +1,6 @@ import { escape, minBy } from 'lodash'; import emojiAliases from 'emojis/aliases.json'; +import { sanitize } from '~/lib/dompurify'; import AccessorUtilities from '../lib/utils/accessor'; import axios from '../lib/utils/axios_utils'; import { CATEGORY_ICON_MAP, FREQUENTLY_USED_KEY } from './constants'; @@ -10,7 +11,7 @@ export const FALLBACK_EMOJI_KEY = 'grey_question'; export const EMOJI_VERSION = '1'; -const isLocalStorageAvailable = AccessorUtilities.isLocalStorageAccessSafe(); +const isLocalStorageAvailable = AccessorUtilities.canUseLocalStorage(); async function loadEmoji() { if ( @@ -34,7 +35,7 @@ async function loadEmoji() { async function loadEmojiWithNames() { return Object.entries(await loadEmoji()).reduce((acc, [key, value]) => { - acc[key] = { ...value, name: key }; + acc[key] = { ...value, name: key, e: sanitize(value.e) }; return acc; }, {}); diff --git a/app/assets/javascripts/emoji/support/unicode_support_map.js b/app/assets/javascripts/emoji/support/unicode_support_map.js index fe3bc75f9fd..d90a774c293 100644 --- a/app/assets/javascripts/emoji/support/unicode_support_map.js +++ b/app/assets/javascripts/emoji/support/unicode_support_map.js @@ -141,7 +141,7 @@ function generateUnicodeSupportMap(testMap) { } export default function getUnicodeSupportMap() { - const isLocalStorageAvailable = AccessorUtilities.isLocalStorageAccessSafe(); + const isLocalStorageAvailable = AccessorUtilities.canUseLocalStorage(); let glEmojiVersionFromCache; let userAgentFromCache; |