fix file naming sanitisation
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user