diff options
author | Unknwon <u@gogs.io> | 2017-02-13 04:20:03 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-02-13 04:20:03 -0500 |
commit | d02e7d9e6a03c266e161ac0b375be4ec32c61b58 (patch) | |
tree | ba520f4b9cd292f7748f705808c5aa9a184bb886 | |
parent | 1c87b082c1545a02293e08773f402b19f1ebaffe (diff) |
install: no need to check SMTPFrom is not set (#4118)
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | routers/install.go | 14 | ||||
-rw-r--r-- | templates/.VERSION | 2 |
3 files changed, 10 insertions, 8 deletions
@@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.145.0212" +const APP_VER = "0.9.145.0213" func init() { setting.AppVer = APP_VER diff --git a/routers/install.go b/routers/install.go index 1df875ae..f4650832 100644 --- a/routers/install.go +++ b/routers/install.go @@ -249,12 +249,14 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) { } // Make sure FROM field is valid - _, err := mail.ParseAddress(form.SMTPFrom) - if err != nil { - ctx.Data["Err_SMTP"] = true - ctx.Data["Err_SMTPFrom"] = true - ctx.RenderWithErr(ctx.Tr("install.invalid_smtp_from", err), INSTALL, &form) - return + if len(form.SMTPFrom) > 0 { + _, err := mail.ParseAddress(form.SMTPFrom) + if err != nil { + ctx.Data["Err_SMTP"] = true + ctx.Data["Err_SMTPFrom"] = true + ctx.RenderWithErr(ctx.Tr("install.invalid_smtp_from", err), INSTALL, &form) + return + } } // Check logic loophole between disable self-registration and no admin account. diff --git a/templates/.VERSION b/templates/.VERSION index d12102fd..4adcf93e 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.145.0212
\ No newline at end of file +0.9.145.0213
\ No newline at end of file |