Skip to content

Node.js based forum software built for the modern web

fix: escape attributes in renderShortcodeEmoji helper

Julian Lam7523dd7b6b5f
diff --git a/public/src/modules/helpers.common.js b/public/src/modules/helpers.common.js
index 29f0eb47d2..71caca1a6c 100644
--- a/public/src/modules/helpers.common.js
+++ b/public/src/modules/helpers.common.js
@@ -558,7 +558,7 @@ module.exports = function (utils, Benchpress, tx, relative_path) {
for (const { clean, hostname } of emojiMeta) {
const code = `:${clean}:`;
const proxyUrl = `/emoji/ap/${encodeURIComponent(clean)}/${encodeURIComponent(hostname)}`;
- const imgTag = `<img class="not-responsive emoji" src="${proxyUrl}" title="${code}" />`;
+ const imgTag = `<img class="not-responsive emoji" src="${escape(proxyUrl)}" title="${escape(code)}" />`;
result = result.split(code).join(imgTag);
}
return result;