mirror of
https://github.com/go-gitea/gitea.git
synced 2024-05-11 05:55:29 +00:00
Clean repo code
This commit is contained in:
@ -267,7 +267,10 @@ func validateStruct(errors *BindingErrors, obj interface{}) {
|
||||
break
|
||||
}
|
||||
case rule == "Url":
|
||||
if !urlPattern.MatchString(fmt.Sprintf("%v", fieldValue)) {
|
||||
str := fmt.Sprintf("%v", fieldValue)
|
||||
if len(str) == 0 {
|
||||
continue
|
||||
} else if !urlPattern.MatchString(str) {
|
||||
errors.Fields[field.Name] = BindingUrlError
|
||||
break
|
||||
}
|
||||
|
Reference in New Issue
Block a user