/echo html allowed sanitize title too

63c6fbaf589139c74e8a0d0aaada3c15c8236c89

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +2 -1Ignore whitespace
public/scripts/slash-commands.js+2 -1
@@ -2227,7 +2227,7 @@ async function echoCallback(args, value) {
22272227 // Make sure that the value is a string
22282228 value = String(value);
22292229
22302230 constlet title = args.title ? args.title : undefined;
22312231 const severity = args.severity ? args.severity : 'info';
22322232
22332233 /** @type {ToastrOptions} */
@@ -2259,6 +2259,7 @@ async function echoCallback(args, value) {
22592259
22602260 // If we allow HTML, we need to sanitize it to prevent security risks
22612261 if (!options.escapeHtml) {
2262+ if (title) title = DOMPurify.sanitize(title, { FORBID_TAGS: ['style'] });
22622263 value = DOMPurify.sanitize(value, { FORBID_TAGS: ['style'] });
22632264 }
22642265