mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 21:45:50 +01:00
Fix validation.
This commit is contained in:
@@ -87,6 +87,8 @@ trait CreateRepositoryControllerBase extends ControllerBase {
|
||||
def validate(name: String, value: String): Option[String] = {
|
||||
if(!value.matches("^[a-zA-Z0-9\\-_]+$")){
|
||||
Some("Repository name contains invalid character.")
|
||||
} else if(value.startsWith("_") || value.startsWith("-")){
|
||||
Some("Repository name starts with invalid character.")
|
||||
} else if(getRepositoryNamesOfUser(context.loginAccount.get.userName).contains(value)){
|
||||
Some("Repository already exists.")
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user