Update modules/validation/helpers.go

Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
Jason Song 2022-11-04 09:35:19 +08:00 committed by GitHub
parent e957aa1ba5
commit 5ef6c022d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,7 +94,7 @@ func IsValidExternalTrackerURLFormat(uri string) bool {
var (
validUsernamePattern = regexp.MustCompile(`^[\da-zA-Z][-.\w]*$`)
invalidUsernamePattern = regexp.MustCompile(`[-._]{2,}|[-._]$`)
invalidUsernamePattern = regexp.MustCompile(`[-._]{2,}|[-._]$`) // No consecutive or trailing non-alphanumeric chars
)
// IsValidUsername checks if username is valid