aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-03 06:52:38 +0800
committerGitHub <noreply@github.com>2021-11-03 00:52:38 +0200
commitf572fb906f3ca019683f3d33dc5c4d58a832af65 (patch)
tree6f2ab472f23d17b1889a87c5ef09e06cf7c53301
parent9340269d8433277807e98059bfb91daa8bc544b4 (diff)
downloadgitea-f572fb906f3ca019683f3d33dc5c4d58a832af65.tar.gz
gitea-f572fb906f3ca019683f3d33dc5c4d58a832af65.zip
fix email with + when active (#17518) (#17520)
Co-authored-by: zeripath <art27@cantab.net>
-rw-r--r--modules/templates/helper.go2
-rw-r--r--templates/mail/auth/activate_email.tmpl2
2 files changed, 3 insertions, 1 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index fcddb59d65..29d83c198f 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -390,6 +390,7 @@ func NewFuncMap() []template.FuncMap {
html += "</span>"
return template.HTML(html)
},
+ "QueryEscape": url.QueryEscape,
}}
}
@@ -510,6 +511,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 6a8de50112..a1d7ec37ec 100644
--- a/templates/mail/auth/activate_email.tmpl
+++ b/templates/mail/auth/activate_email.tmpl
@@ -5,7 +5,7 @@
<title>{{.i18n.Tr "mail.activate_email.title" .DisplayName}}</title>
</head>
-{{ $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)}}
<body>
<p>{{.i18n.Tr "mail.hi_user_x" .DisplayName | Str2html}}</p><br>
<p>{{.i18n.Tr "mail.activate_email.text" .ActiveCodeLives | Str2html}}</p><p><a href="{{$activate_url}}">{{$activate_url}}</a></p><br>