mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
/echo html allowed sanitize title too
This commit is contained in:
@ -2227,7 +2227,7 @@ async function echoCallback(args, value) {
|
|||||||
// Make sure that the value is a string
|
// Make sure that the value is a string
|
||||||
value = String(value);
|
value = String(value);
|
||||||
|
|
||||||
const title = args.title ? args.title : undefined;
|
let title = args.title ? args.title : undefined;
|
||||||
const severity = args.severity ? args.severity : 'info';
|
const severity = args.severity ? args.severity : 'info';
|
||||||
|
|
||||||
/** @type {ToastrOptions} */
|
/** @type {ToastrOptions} */
|
||||||
@ -2259,6 +2259,7 @@ async function echoCallback(args, value) {
|
|||||||
|
|
||||||
// If we allow HTML, we need to sanitize it to prevent security risks
|
// If we allow HTML, we need to sanitize it to prevent security risks
|
||||||
if (!options.escapeHtml) {
|
if (!options.escapeHtml) {
|
||||||
|
if (title) title = DOMPurify.sanitize(title, { FORBID_TAGS: ['style'] });
|
||||||
value = DOMPurify.sanitize(value, { FORBID_TAGS: ['style'] });
|
value = DOMPurify.sanitize(value, { FORBID_TAGS: ['style'] });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user