Skip to content

Commit e947e57

Browse files
committed
Clean up
1 parent d703297 commit e947e57

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

models/user/user.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ import (
3030
"code.gitea.io/gitea/modules/timeutil"
3131
"code.gitea.io/gitea/modules/util"
3232
"code.gitea.io/gitea/modules/validation"
33+
3334
"golang.org/x/text/runes"
3435
"golang.org/x/text/transform"
3536
"golang.org/x/text/unicode/norm"
36-
3737
"xorm.io/builder"
3838
)
3939

@@ -522,9 +522,11 @@ func GetUserSalt() (string, error) {
522522

523523
// Developer warning: The set of characters here can safely expand without a breaking change,
524524
// but characters removed from this set can cause user account linking to break
525-
var invalidUsernameCharsRE = regexp.MustCompile(`[^\w-.]`)
526-
var removeDiacriticsTransform = transform.Chain(norm.NFD, runes.Remove(runes.In(unicode.Mn)), norm.NFC)
527-
var removeChars = strings.NewReplacer("'", "")
525+
var (
526+
invalidUsernameCharsRE = regexp.MustCompile(`[^\w-.]`)
527+
removeDiacriticsTransform = transform.Chain(norm.NFD, runes.Remove(runes.In(unicode.Mn)), norm.NFC)
528+
removeChars = strings.NewReplacer("'", "", "`", "")
529+
)
528530

529531
// normalizeUserName returns a string with single-quotes and diacritics
530532
// removed, and any other non-supported username characters replaced with

0 commit comments

Comments
 (0)