/echo html allowed sanitize title too
| @@ -2227,7 +2227,7 @@ async function echoCallback(args, value) { | |||
| 2227 | // Make sure that the value is a string | 2227 | // Make sure that the value is a string |
| 2228 | value = String(value); | 2228 | value = String(value); |
| 2229 | 2229 | ||
| 2230 | const title = args.title ? args.title : undefined; | 2230 | let title = args.title ? args.title : undefined; |
| 2231 | const severity = args.severity ? args.severity : 'info'; | 2231 | const severity = args.severity ? args.severity : 'info'; |
| 2232 | 2232 | ||
| 2233 | /** @type {ToastrOptions} */ | 2233 | /** @type {ToastrOptions} */ |
| @@ -2259,6 +2259,7 @@ async function echoCallback(args, value) { | |||
| 2259 | 2259 | ||
| 2260 | // If we allow HTML, we need to sanitize it to prevent security risks | 2260 | // If we allow HTML, we need to sanitize it to prevent security risks |
| 2261 | if (!options.escapeHtml) { | 2261 | if (!options.escapeHtml) { |
| 2262 | if (title) title = DOMPurify.sanitize(title, { FORBID_TAGS: ['style'] }); | ||
| 2262 | value = DOMPurify.sanitize(value, { FORBID_TAGS: ['style'] }); | 2263 | value = DOMPurify.sanitize(value, { FORBID_TAGS: ['style'] }); |
| 2263 | } | 2264 | } |
| 2264 | 2265 | ||