fix file naming sanitisation

This commit is contained in:
2026-03-23 17:46:27 +01:00
parent 5bcca61d59
commit 82eb9de5f1
4 changed files with 32 additions and 35 deletions

View File

@@ -3,11 +3,9 @@ package file
import (
"ResendIt/internal/util"
"archive/zip"
"crypto/rand"
"errors"
"fmt"
"io"
"math/big"
"mime/multipart"
"os"
"path/filepath"
@@ -39,17 +37,6 @@ func dedupeName(name string, seen map[string]int) string {
return fmt.Sprintf("%s (%d)%s", base, seen[name], ext)
}
func randIndex(n int) int {
if n <= 0 {
return 0
}
x, err := rand.Int(rand.Reader, big.NewInt(int64(n)))
if err != nil {
return 0
}
return int(x.Int64())
}
func cuteZipName(fileCount int) string {
adjective := util.RandomAdjective()
verb := util.RandomVerb()