fix: escape print-window fields and re-sanitize body to block XSS

This commit is contained in:
Linus Rath
2026-05-18 13:24:52 +02:00
parent c2eb2c081b
commit 7efd8d59bf
2 changed files with 22 additions and 10 deletions
+1 -1
View File
@@ -131,7 +131,7 @@ const HTML_ESCAPES: Record<string, string> = {
"'": '&#39;',
};
function escapeHtml(str: string): string {
export function escapeHtml(str: string): string {
return str.replace(/[&<>"']/g, (c) => HTML_ESCAPES[c]);
}