Skip to content

Commit b266534

Browse files
committed
More escaping
Signed-off-by: Andrew Thornton <[email protected]>
1 parent b96b85e commit b266534

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

templates/mail/issue/default.tmpl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,26 +36,26 @@
3636
{{end}}
3737
<p>
3838
{{if eq .ActionName "close"}}
39-
{{.i18n.Tr "mail.issue.action.close" .Doer.Name .Issue.Index | Str2html}}
39+
{{.i18n.Tr "mail.issue.action.close" (Escape .Doer.Name) .Issue.Index | Str2html}}
4040
{{else if eq .ActionName "reopen"}}
41-
{{.i18n.Tr "mail.issue.action.reopen" .Doer.Name .Issue.Index | Str2html}}
41+
{{.i18n.Tr "mail.issue.action.reopen" (Escape .Doer.Name) .Issue.Index | Str2html}}
4242
{{else if eq .ActionName "merge"}}
43-
{{.i18n.Tr "mail.issue.action.merge" .Doer.Name .Issue.Index .Issue.PullRequest.BaseBranch | Str2html}}
43+
{{.i18n.Tr "mail.issue.action.merge" (Escape .Doer.Name) .Issue.Index (Escape .Issue.PullRequest.BaseBranch) | Str2html}}
4444
{{else if eq .ActionName "approve"}}
45-
{{.i18n.Tr "mail.issue.action.approve" .Doer.Name | Str2html}}
45+
{{.i18n.Tr "mail.issue.action.approve" (Escape .Doer.Name) | Str2html}}
4646
{{else if eq .ActionName "reject"}}
47-
{{.i18n.Tr "mail.issue.action.reject" .Doer.Name | Str2html}}
47+
{{.i18n.Tr "mail.issue.action.reject" (Escape .Doer.Name) | Str2html}}
4848
{{else if eq .ActionName "review"}}
49-
{{.i18n.Tr "mail.issue.action.review" .Doer.Name | Str2html}}
49+
{{.i18n.Tr "mail.issue.action.review" (Escape .Doer.Name) | Str2html}}
5050
{{else if eq .ActionName "review_dismissed"}}
51-
{{.i18n.Tr "mail.issue.action.review_dismissed" .Doer.Name .Comment.Review.Reviewer.Name | Str2html}}
51+
{{.i18n.Tr "mail.issue.action.review_dismissed" (Escape .Doer.Name) (Escape .Comment.Review.Reviewer.Name) | Str2html}}
5252
{{else if eq .ActionName "ready_for_review"}}
53-
{{.i18n.Tr "mail.issue.action.ready_for_review" .Doer.Name | Str2html}}
53+
{{.i18n.Tr "mail.issue.action.ready_for_review" (Escape .Doer.Name) | Str2html}}
5454
{{end}}
5555

5656
{{- if eq .Body ""}}
5757
{{if eq .ActionName "new"}}
58-
{{.i18n.Tr "mail.issue.action.new" .Doer.Name .Issue.Index | Str2html}}
58+
{{.i18n.Tr "mail.issue.action.new" (Escape .Doer.Name) .Issue.Index | Str2html}}
5959
{{end}}
6060
{{else}}
6161
{{.Body | Str2html}}

templates/repo/create.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{{template "base/alert" .}}
1212

1313
{{if not $.DisableMigrations}}
14-
<p class="ui center">{{.i18n.Tr "repo.new_repo_helper" (printf "%s%s" AppSubUrl "/repo/migrate") | Safe}}</p>
14+
<p class="ui center">{{.i18n.Tr "repo.new_repo_helper" ((printf "%s%s" AppSubUrl "/repo/migrate")|Escape) | Safe}}</p>
1515
{{end}}
1616

1717
{{if not .CanCreateRepo}}

templates/repo/issue/view_content/comments.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
{{if eq .RefAction 3}}</del>{{end}}
159159

160160
<div class="detail">
161-
<span class="text grey"><a href="{{.RefIssueHTMLURL}}"><b>{{.RefIssueTitle | Str2html}}</b> {{.RefIssueIdent | Str2html}}</a></span>
161+
<span class="text grey"><a href="{{.RefIssueHTMLURL}}"><b>{{.RefIssueTitle}}</b> {{.RefIssueIdent}}</a></span>
162162
</div>
163163
</div>
164164
{{else if eq .Type 4}}

templates/user/dashboard/feeds.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{{if eq .GetOpType 1}}
1616
{{$.i18n.Tr "action.create_repo" (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}}
1717
{{else if eq .GetOpType 2}}
18-
{{$.i18n.Tr "action.rename_repo" .GetContent (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}}
18+
{{$.i18n.Tr "action.rename_repo" (.GetContent|Escape) (.GetRepoLink|Escape) (.ShortRepoPath|Escape) | Str2html}}
1919
{{else if eq .GetOpType 5}}
2020
{{ $branchLink := .GetBranch | PathEscapeSegments | Escape}}
2121
{{if .Content}}

0 commit comments

Comments
 (0)