mirror of
https://github.com/ergochat/ergo.git
synced 2025-01-11 04:32:39 +01:00
fix #1722
Validate operator vhosts against the configured (or default) vhosts.valid-regexp
This commit is contained in:
parent
9af6b86868
commit
0751f31b9e
@ -830,6 +830,9 @@ func (conf *Config) Operators(oc map[string]*OperClass) (map[string]*Oper, error
|
|||||||
}
|
}
|
||||||
|
|
||||||
oper.Vhost = opConf.Vhost
|
oper.Vhost = opConf.Vhost
|
||||||
|
if oper.Vhost != "" && !conf.Accounts.VHosts.validRegexp.MatchString(oper.Vhost) {
|
||||||
|
return nil, fmt.Errorf("Oper %s has an invalid vhost: `%s`", name, oper.Vhost)
|
||||||
|
}
|
||||||
class, exists := oc[opConf.Class]
|
class, exists := oc[opConf.Class]
|
||||||
if !exists {
|
if !exists {
|
||||||
return nil, fmt.Errorf("Could not load operator [%s] - they use operclass [%s] which does not exist", name, opConf.Class)
|
return nil, fmt.Errorf("Could not load operator [%s] - they use operclass [%s] which does not exist", name, opConf.Class)
|
||||||
|
Loading…
Reference in New Issue
Block a user