chore: use more standard golangci-lint options

This commit is contained in:
Henrique Dias 2025-11-14 16:18:12 +01:00
parent 0d973d3aad
commit 9d44932dba
No known key found for this signature in database
8 changed files with 15 additions and 138 deletions

View file

@ -42,7 +42,7 @@ func (s *Settings) MakeUserDir(username, userScope, serverRoot string) (string,
func cleanUsername(s string) string {
// Remove any trailing space to avoid ending on -
s = strings.Trim(s, " ")
s = strings.Replace(s, "..", "", -1)
s = strings.ReplaceAll(s, "..", "")
// Replace all characters which not in the list `0-9A-Za-z@_\-.` with a dash
s = invalidFilenameChars.ReplaceAllString(s, "-")