fix: improper neutralization of user input in image wrapping code

(Backport of: 1d1639d46f)
This commit is contained in:
Julian Lam
2023-06-13 14:53:16 -04:00
parent dd5ed9e507
commit 9ec7ab4afc

View File

@@ -24,7 +24,7 @@ define('forum/topic/images', [], function () {
if (!$this.parent().is('a')) {
$this.wrap('<a href="' + src + '" ' +
(!srcExt && altExt ? ' download="' + altFilename + '" ' : '') +
(!srcExt && altExt ? ' download="' + utils.escapeHTML(altFilename) + '" ' : '') +
' target="_blank" rel="noopener">');
}
});