From ede3ea4e432ac513c0e3f585cb134b57d19a0fc6 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Mon, 30 Jun 2025 07:22:13 +0200 Subject: [PATCH] Fix SOA filename Signed-off-by: Bryan Frimin --- pkg/probo/framework_service.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkg/probo/framework_service.go b/pkg/probo/framework_service.go index b0478aaae..98943cdcd 100644 --- a/pkg/probo/framework_service.go +++ b/pkg/probo/framework_service.go @@ -985,8 +985,16 @@ func (s FrameworkService) applyExcelFormatting(f *excelize.File, sheetName strin func (s FrameworkService) generateSOAFileName(framework *coredata.Framework) string { now := time.Now() + + // Sanitize framework name by replacing invalid file name characters + sanitizedName := framework.Name + invalidChars := []string{"/", "\\", ":", "*", "?", "\"", "<", ">", "|", " "} + for _, char := range invalidChars { + sanitizedName = strings.ReplaceAll(sanitizedName, char, "_") + } + return fmt.Sprintf("SOA_%s_%s.xlsx", - strings.ReplaceAll(framework.Name, " ", "_"), + sanitizedName, now.Format("20060102_150405")) }