mirror of
https://github.com/safing/portmaster
synced 2025-09-02 02:29:12 +00:00
Add validation to non-negative int config options
This commit is contained in:
parent
d13cfb1bb4
commit
b60427c68b
2 changed files with 2 additions and 0 deletions
|
@ -76,6 +76,7 @@ func registerConfig() error {
|
||||||
config.UnitAnnotation: "seconds",
|
config.UnitAnnotation: "seconds",
|
||||||
config.CategoryAnnotation: "General",
|
config.CategoryAnnotation: "General",
|
||||||
},
|
},
|
||||||
|
ValidationRegex: `^[1-9][0-9]{1,5}?$`,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -166,6 +166,7 @@ The format is: "protocol://ip:port?parameter=value¶meter=value"
|
||||||
config.UnitAnnotation: "seconds",
|
config.UnitAnnotation: "seconds",
|
||||||
config.CategoryAnnotation: "Servers",
|
config.CategoryAnnotation: "Servers",
|
||||||
},
|
},
|
||||||
|
ValidationRegex: `^[1-9][0-9]{1,5}?$`,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Add table
Reference in a new issue