fix email with + when active (#17518) (#17520)

Co-authored-by: zeripath <art27@cantab.net>
This commit is contained in:
Lunny Xiao 2021-11-03 06:52:38 +08:00 committed by GitHub
parent 9340269d84
commit f572fb906f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -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,
}}
}

View File

@ -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>