]> source.dussan.org Git - gitea.git/commitdiff
fix email with + when active (#17518) (#17520)
authorLunny Xiao <xiaolunwen@gmail.com>
Tue, 2 Nov 2021 22:52:38 +0000 (06:52 +0800)
committerGitHub <noreply@github.com>
Tue, 2 Nov 2021 22:52:38 +0000 (00:52 +0200)
Co-authored-by: zeripath <art27@cantab.net>
modules/templates/helper.go
templates/mail/auth/activate_email.tmpl

index fcddb59d6513013d946bcfdf6d346547e528417c..29d83c198f1c6a5024ef3954ba78bd6ddb0fb3c1 100644 (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,
        }}
 }
 
index 6a8de50112071221e21918f729ed2703652a1535..a1d7ec37ec5dc787cef8a3f40e374f74d1f1d1f6 100644 (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>