summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-02-18 22:06:37 +0200
committerGitHub <noreply@github.com>2018-02-18 22:06:37 +0200
commitae30315a62644774756df64af0ca1ef405853a57 (patch)
treece2b64280c81a52560a096260be1b851a781c6df /templates
parent96c268c0fcc22604103f67821d66fef39944e80b (diff)
downloadgitea-ae30315a62644774756df64af0ca1ef405853a57.tar.gz
gitea-ae30315a62644774756df64af0ca1ef405853a57.zip
Fix escaping changed title in comments (#3530)
* Fix escaping changed title in comments * Fix escaping of wiki page titile Signed-off-by: Lauris Bukšis-Haberkorns <lauris@nix.lv>
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/issue/view_content/comments.tmpl28
-rw-r--r--templates/repo/wiki/view.tmpl2
2 files changed, 15 insertions, 15 deletions
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index 49a0216e83..3557c5d3c1 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -103,7 +103,7 @@
<img src="{{.Poster.RelAvatarLink}}">
</a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
- {{if .Content}}{{$.i18n.Tr "repo.issues.add_label_at" .Label.ForegroundColor .Label.Color .Label.Name $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_label_at" .Label.ForegroundColor .Label.Color .Label.Name $createdStr | Safe}}{{end}}</span>
+ {{if .Content}}{{$.i18n.Tr "repo.issues.add_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_label_at" .Label.ForegroundColor .Label.Color (.Label.Name|Escape) $createdStr | Safe}}{{end}}</span>
</div>
{{end}}
{{else if eq .Type 8}}
@@ -113,7 +113,7 @@
<img src="{{.Poster.RelAvatarLink}}">
</a>
<span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
- {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.change_milestone_at" .OldMilestone.Name .Milestone.Name $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_milestone_at" .OldMilestone.Name $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.add_milestone_at" .Milestone.Name $createdStr | Safe}}{{end}}</span>
+ {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.change_milestone_at" (.OldMilestone.Name|Escape) (.Milestone.Name|Escape) $createdStr | Safe}}{{else}}{{$.i18n.Tr "repo.issues.remove_milestone_at" (.OldMilestone.Name|Escape) $createdStr | Safe}}{{end}}{{else if gt .MilestoneID 0}}{{$.i18n.Tr "repo.issues.add_milestone_at" (.Milestone.Name|Escape) $createdStr | Safe}}{{end}}</span>
</div>
{{else if eq .Type 9}}
<div class="event">
@@ -131,23 +131,23 @@
{{else if eq .Type 10}}
<div class="event">
<span class="octicon octicon-primitive-dot"></span>
+ <a class="ui avatar image" href="{{.Poster.HomeLink}}">
+ <img src="{{.Poster.RelAvatarLink}}">
+ </a>
+ <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
+ {{$.i18n.Tr "repo.issues.change_title_at" (.OldTitle|Escape) (.NewTitle|Escape) $createdStr | Safe}}
+ </span>
</div>
- <a class="ui avatar image" href="{{.Poster.HomeLink}}">
- <img src="{{.Poster.RelAvatarLink}}">
- </a>
- <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
- {{$.i18n.Tr "repo.issues.change_title_at" .OldTitle .NewTitle $createdStr | Safe}}
- </span>
{{else if eq .Type 11}}
<div class="event">
<span class="octicon octicon-primitive-dot"></span>
+ <a class="ui avatar image" href="{{.Poster.HomeLink}}">
+ <img src="{{.Poster.RelAvatarLink}}">
+ </a>
+ <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
+ {{$.i18n.Tr "repo.issues.delete_branch_at" .CommitSHA $createdStr | Safe}}
+ </span>
</div>
- <a class="ui avatar image" href="{{.Poster.HomeLink}}">
- <img src="{{.Poster.RelAvatarLink}}">
- </a>
- <span class="text grey"><a href="{{.Poster.HomeLink}}">{{.Poster.Name}}</a>
- {{$.i18n.Tr "repo.issues.delete_branch_at" .CommitSHA $createdStr | Safe}}
- </span>
{{else if eq .Type 12}}
<div class="event">
<span class="octicon octicon-primitive-dot"></span>
diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl
index dfd368cd3d..93b7c10640 100644
--- a/templates/repo/wiki/view.tmpl
+++ b/templates/repo/wiki/view.tmpl
@@ -104,7 +104,7 @@
{{.i18n.Tr "repo.wiki.delete_page_button"}}
</div>
<div class="content">
- <p>{{.i18n.Tr "repo.wiki.delete_page_notice_1" $title | Safe}}</p>
+ <p>{{.i18n.Tr "repo.wiki.delete_page_notice_1" ($title|Escape) | Safe}}</p>
</div>
{{template "base/delete_modal_actions" .}}
</div>