From c2baa4b752e4ce7189f081a8cbe0a832bb1f880d Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 1 Nov 2024 19:43:39 +0200 Subject: [PATCH] server: Add comment to clarify use of regex --- src/services/export/zip.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/services/export/zip.ts b/src/services/export/zip.ts index 5e30e62974..75feeebc6a 100644 --- a/src/services/export/zip.ts +++ b/src/services/export/zip.ts @@ -61,6 +61,7 @@ async function exportToZip(taskContext: TaskContext, branch: BBranch, format: "h // Crop fileName to avoid its length exceeding 30 and prevent cutting into the extension. if (fileName.length > 30) { + // We use regex to match the extension to preserve multiple dots in extensions (e.g. .tar.gz). let match = fileName.match(/(\.[a-zA-Z0-9_.!#-]+)$/); let ext = match ? match[0] : ''; // Crop the extension if extension length exceeds 30