code refactor for name checker
This commit is contained in:
parent
8a06cac5f1
commit
3236d7dfd1
|
@ -28,6 +28,10 @@ func (c *Classpath) Validate() error {
|
|||
return _e("Classpath path has invalid characters")
|
||||
}
|
||||
|
||||
if strings.Contains(c.Path, " ") {
|
||||
return _e("Classpath path has invalid characters")
|
||||
}
|
||||
|
||||
if str.Dangerous(c.Note) {
|
||||
return _e("Classpath note has invalid characters")
|
||||
}
|
||||
|
|
|
@ -33,6 +33,11 @@ func (d *Dashboard) Validate() error {
|
|||
if str.Dangerous(d.Name) {
|
||||
return _e("Dashboard name has invalid characters")
|
||||
}
|
||||
|
||||
if strings.Contains(d.Name, "://") {
|
||||
return _e("Dashboard name has invalid characters")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue