From 59d0e65e2093f402f83f63f1fe9dc4852660960e Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 2 Nov 2021 14:26:13 +0800 Subject: [PATCH 1/2] fix email with + when active (#17518) Co-authored-by: zeripath --- modules/templates/helper.go | 1 + templates/mail/auth/activate_email.tmpl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/templates/helper.go b/modules/templates/helper.go index fcddb59d65130..54b12be3feccf 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -510,6 +510,7 @@ func NewTextFuncMap() []texttmpl.FuncMap { } return sum }, + "QueryEscape": url.QueryEscape, }} } diff --git a/templates/mail/auth/activate_email.tmpl b/templates/mail/auth/activate_email.tmpl index 6a8de50112071..a1d7ec37ec5dc 100644 --- a/templates/mail/auth/activate_email.tmpl +++ b/templates/mail/auth/activate_email.tmpl @@ -5,7 +5,7 @@ {{.i18n.Tr "mail.activate_email.title" .DisplayName}} -{{ $activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl .Code .Email}} +{{ $activate_url := printf "%suser/activate_email?code=%s&email=%s" AppUrl .Code (QueryEscape .Email)}}

{{.i18n.Tr "mail.hi_user_x" .DisplayName | Str2html}}


{{.i18n.Tr "mail.activate_email.text" .ActiveCodeLives | Str2html}}

{{$activate_url}}


From fadf154a4647aad41677988098a7d5e82dd55dd4 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 2 Nov 2021 23:03:12 +0800 Subject: [PATCH 2/2] Fix another place --- modules/templates/helper.go | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 54b12be3feccf..29d83c198f1c6 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -390,6 +390,7 @@ func NewFuncMap() []template.FuncMap { html += "" return template.HTML(html) }, + "QueryEscape": url.QueryEscape, }} }