From ce49bb18a5f7ea62148f4621e95ebe3e9e4aa2a2 Mon Sep 17 00:00:00 2001 From: Jeff Walden Date: Tue, 4 Feb 2025 12:02:29 -0800 Subject: [PATCH] fix: Also escape backslashes in the Content-Disposition legacy filename parameter. (#3245) --- companion/lib/ImportExport/Controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/companion/lib/ImportExport/Controller.ts b/companion/lib/ImportExport/Controller.ts index a281252e8..714289ea0 100644 --- a/companion/lib/ImportExport/Controller.ts +++ b/companion/lib/ImportExport/Controller.ts @@ -109,7 +109,7 @@ function attachmentWithFilename(filename: string): string { '"' + [...s.normalize('NFKD')] .filter((c) => '\x20' <= c && c <= '\x7e') - .map((c) => (c === '"' ? '\\"' : c)) + .map((c) => (c === '"' || c === '\\' ? '\\' : '') + c) .join('') + '"' )