diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-02-25 22:02:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-25 14:02:20 +0000 |
commit | d2f6588b66549b33adf8bac7044d03c89d668470 (patch) | |
tree | 7cc1109b7bd757ffd9e9e9cc2eb038b024290f3f /templates/mail | |
parent | ea164aba4b697aa08e4d20d896a8f318c09a6523 (diff) | |
download | gitea-d2f6588b66549b33adf8bac7044d03c89d668470.tar.gz gitea-d2f6588b66549b33adf8bac7044d03c89d668470.zip |
Remove incorrect and unnecessary Escape from templates (#29394)
Follow #29165
* some of them are incorrect, which would lead to double escaping (eg:
`(print (Escape $.RepoLink)`)
* other of them are not necessary, because `Tr` handles strings&HTML
automatically
Suggest to review by "unified view":
https://github.com/go-gitea/gitea/pull/29394/files?diff=unified&w=0
Diffstat (limited to 'templates/mail')
-rw-r--r-- | templates/mail/auth/register_notify.tmpl | 2 | ||||
-rw-r--r-- | templates/mail/issue/default.tmpl | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/templates/mail/auth/register_notify.tmpl b/templates/mail/auth/register_notify.tmpl index ec3e09dd5f..62dbf7d927 100644 --- a/templates/mail/auth/register_notify.tmpl +++ b/templates/mail/auth/register_notify.tmpl @@ -11,7 +11,7 @@ <p>{{.locale.Tr "mail.hi_user_x" (.DisplayName|DotEscape)}}</p><br> <p>{{.locale.Tr "mail.register_notify.text_1" AppName}}</p><br> <p>{{.locale.Tr "mail.register_notify.text_2" .Username}}</p><p><a href="{{AppUrl}}user/login">{{AppUrl}}user/login</a></p><br> - <p>{{.locale.Tr "mail.register_notify.text_3" ($set_pwd_url | Escape)}}</p><br> + <p>{{.locale.Tr "mail.register_notify.text_3" $set_pwd_url}}</p><br> <p>© <a target="_blank" rel="noopener noreferrer" href="{{AppUrl}}">{{AppName}}</a></p> </body> diff --git a/templates/mail/issue/default.tmpl b/templates/mail/issue/default.tmpl index c48797d827..79dbe897cc 100644 --- a/templates/mail/issue/default.tmpl +++ b/templates/mail/issue/default.tmpl @@ -36,26 +36,26 @@ {{end}} <p> {{if eq .ActionName "close"}} - {{.locale.Tr "mail.issue.action.close" (Escape .Doer.Name) .Issue.Index}} + {{.locale.Tr "mail.issue.action.close" .Doer.Name .Issue.Index}} {{else if eq .ActionName "reopen"}} - {{.locale.Tr "mail.issue.action.reopen" (Escape .Doer.Name) .Issue.Index}} + {{.locale.Tr "mail.issue.action.reopen" .Doer.Name .Issue.Index}} {{else if eq .ActionName "merge"}} - {{.locale.Tr "mail.issue.action.merge" (Escape .Doer.Name) .Issue.Index (Escape .Issue.PullRequest.BaseBranch)}} + {{.locale.Tr "mail.issue.action.merge" .Doer.Name .Issue.Index .Issue.PullRequest.BaseBranch}} {{else if eq .ActionName "approve"}} - {{.locale.Tr "mail.issue.action.approve" (Escape .Doer.Name)}} + {{.locale.Tr "mail.issue.action.approve" .Doer.Name}} {{else if eq .ActionName "reject"}} - {{.locale.Tr "mail.issue.action.reject" (Escape .Doer.Name)}} + {{.locale.Tr "mail.issue.action.reject" .Doer.Name}} {{else if eq .ActionName "review"}} - {{.locale.Tr "mail.issue.action.review" (Escape .Doer.Name)}} + {{.locale.Tr "mail.issue.action.review" .Doer.Name}} {{else if eq .ActionName "review_dismissed"}} - {{.locale.Tr "mail.issue.action.review_dismissed" (Escape .Doer.Name) (Escape .Comment.Review.Reviewer.Name)}} + {{.locale.Tr "mail.issue.action.review_dismissed" .Doer.Name .Comment.Review.Reviewer.Name}} {{else if eq .ActionName "ready_for_review"}} - {{.locale.Tr "mail.issue.action.ready_for_review" (Escape .Doer.Name)}} + {{.locale.Tr "mail.issue.action.ready_for_review" .Doer.Name}} {{end}} {{- if eq .Body ""}} {{if eq .ActionName "new"}} - {{.locale.Tr "mail.issue.action.new" (Escape .Doer.Name) .Issue.Index}} + {{.locale.Tr "mail.issue.action.new" .Doer.Name .Issue.Index}} {{end}} {{else}} {{.Body | Str2html}} |