From 952e510dfa6f4d20842bf2216286710f0b1a233c Mon Sep 17 00:00:00 2001 From: Flare Date: Wed, 21 Dec 2016 19:24:23 -0500 Subject: [PATCH] Added public entries to reserved keywords list Closes #3728 --- models/user.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/models/user.go b/models/user.go index a027a047c..7946915df 100644 --- a/models/user.go +++ b/models/user.go @@ -489,12 +489,12 @@ func NewGhostUser() *User { } var ( - reversedUsernames = []string{"debug", "raw", "install", "api", "avatar", "user", "org", "help", "stars", "issues", "pulls", "commits", "repo", "template", "admin", "new", ".", ".."} - reversedUserPatterns = []string{"*.keys"} + reservedUsernames = []string{"assets", "css", "img", "js", "less", "plugins", "debug", "raw", "install", "api", "avatar", "user", "org", "help", "stars", "issues", "pulls", "commits", "repo", "template", "admin", "new", ".", ".."} + reservedUserPatterns = []string{"*.keys"} ) // isUsableName checks if name is reserved or pattern of name is not allowed -// based on given reversed names and patterns. +// based on given reserved names and patterns. // Names are exact match, patterns can be prefix or suffix match with placeholder '*'. func isUsableName(names, patterns []string, name string) error { name = strings.TrimSpace(strings.ToLower(name)) @@ -519,7 +519,7 @@ func isUsableName(names, patterns []string, name string) error { } func IsUsableUsername(name string) error { - return isUsableName(reversedUsernames, reversedUserPatterns, name) + return isUsableName(reservedUsernames, reservedUserPatterns, name) } // CreateUser creates record of a new user.