Fix SOA filename

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2025-06-30 07:22:13 +02:00
parent 8b109e7569
commit ede3ea4e43

View File

@@ -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"))
}