mirror of
https://github.com/axllent/mailpit.git
synced 2025-07-15 01:25:10 +02:00
Feature: Expand custom webroot path to include a-z A-Z 0-9 _ . - and /
@see #64
This commit is contained in:
@ -160,9 +160,9 @@ func VerifyConfig() error {
|
|||||||
SMTPAuth = a
|
SMTPAuth = a
|
||||||
}
|
}
|
||||||
|
|
||||||
validWebrootRe := regexp.MustCompile(`[^0-9a-zA-Z\/-]`)
|
validWebrootRe := regexp.MustCompile(`[^0-9a-zA-Z\/\-\_\.]`)
|
||||||
if validWebrootRe.MatchString(Webroot) {
|
if validWebrootRe.MatchString(Webroot) {
|
||||||
return fmt.Errorf("Invalid characters in Webroot (%s). Valid chars: a-z, A-Z, 0-9, - and /", Webroot)
|
return fmt.Errorf("Invalid characters in Webroot (%s). Valid chars include: [a-z A-Z 0-9 _ . - /]", Webroot)
|
||||||
}
|
}
|
||||||
|
|
||||||
s := strings.TrimRight(path.Join("/", Webroot, "/"), "/") + "/"
|
s := strings.TrimRight(path.Join("/", Webroot, "/"), "/") + "/"
|
||||||
|
Reference in New Issue
Block a user