summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2018-02-19 04:33:51 +0200
committerBo-Yi Wu <appleboy.tw@gmail.com>2018-02-19 10:33:51 +0800
commitc503eac2060cdbeb0acae8ae108378dcf3a10fc8 (patch)
treedcf194841c2bc550ecd107d7021c314185bfacdd /templates
parent221e502297e60eb424f047ad32a0d4036627f1ae (diff)
downloadgitea-c503eac2060cdbeb0acae8ae108378dcf3a10fc8.tar.gz
gitea-c503eac2060cdbeb0acae8ae108378dcf3a10fc8.zip
Fix escaping changed title in comments (#3530) (#3534)
* 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>