Make mailvalidation stricter
This commit is contained in:
parent
b6ad8d848a
commit
ec24c6c4dc
1 changed files with 1 additions and 1 deletions
|
@ -112,7 +112,7 @@ func (b *BaseHandler) AddOfficeHourHandler(w http.ResponseWriter, req *http.Requ
|
||||||
if err != nil {
|
if err != nil {
|
||||||
email = &mail.Address{Name: "", Address: req.FormValue("email")}
|
email = &mail.Address{Name: "", Address: req.FormValue("email")}
|
||||||
errors = append(errors, "Mailaddresse konnte nicht geparst werden.")
|
errors = append(errors, "Mailaddresse konnte nicht geparst werden.")
|
||||||
} else if !strings.HasSuffix(email.Address, b.config.Tutor.MailSuffix) {
|
} else if !(strings.HasSuffix(email.Address, "@"+b.config.Tutor.MailSuffix) || strings.HasSuffix(email.Address, "."+b.config.Tutor.MailSuffix)) {
|
||||||
errors = append(errors, fmt.Sprintf("Mailaddresse muss auf „%s“ enden.", b.config.Tutor.MailSuffix))
|
errors = append(errors, fmt.Sprintf("Mailaddresse muss auf „%s“ enden.", b.config.Tutor.MailSuffix))
|
||||||
}
|
}
|
||||||
info := req.FormValue("info")
|
info := req.FormValue("info")
|
||||||
|
|
Loading…
Reference in a new issue