Skip to content

Commit

Permalink
Blacklist System as Username (#9060)
Browse files Browse the repository at this point in the history
adapted tests
  • Loading branch information
DSchalla authored and grundleborg committed Jul 9, 2018
1 parent 9e5ec7d commit e8b8ef3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions model/user.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ var restrictedUsernames = []string{
"all",
"channel",
"matterbot",
"system",
}

func IsValidUsername(s string) bool {
Expand Down
1 change: 1 addition & 0 deletions model/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ var usernames = []struct {
{"spin'punch", false},
{"spin*punch", false},
{"all", false},
{"system", false},
}

func TestValidUsername(t *testing.T) {
Expand Down

0 comments on commit e8b8ef3

Please sign in to comment.