mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-06 21:45:50 +01:00
Fix validation.
This commit is contained in:
@@ -183,8 +183,8 @@ trait WikiControllerBase extends ControllerBase {
|
||||
def validate(name: String, value: String): Option[String] = {
|
||||
if(!value.matches("^[a-zA-Z0-9\\-_]+$")){
|
||||
Some("Page name contains invalid character.")
|
||||
} else if(value.startsWith("_")){
|
||||
Some("Page name can not start with '_'.")
|
||||
} else if(value.startsWith("_") || value.startsWith("-")){
|
||||
Some("Page name starts with invalid character.")
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user