Skip to content

Commit

Permalink
trimmed spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Roaster05 committed Nov 7, 2024
1 parent ce8c1d3 commit bf12e18
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/utils/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func FormatSize(size int64) string {

// ValidateUserName checks if the username is valid by length and allowed characters.
func ValidateUserName(username string) bool {
username = strings.TrimSpace(username)
return len(username) >= 1 && len(username) <= 255 && !strings.ContainsAny(username, `,"~#%$`)
}

Expand Down

0 comments on commit bf12e18

Please sign in to comment.