Browse Source

SECURITY: fix branch name persistent XSS

Reported by Carl Hattenfels.
pull/4825/head
Unknwon 7 years ago
parent
commit
b727e0be71
No known key found for this signature in database
GPG Key ID: 25B575AE3213B2B3
  1. 3
      templates/repo/editor/commit_form.tmpl
  2. 2
      templates/repo/issue/view_title.tmpl

3
templates/repo/editor/commit_form.tmpl

@ -14,7 +14,8 @@
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" {{if eq .commit_choice "direct"}}checked{{end}}>
<label>
<i class="octicon octicon-git-commit" height="16" width="14"></i>
{{.i18n.Tr "repo.editor.commit_directly_to_this_branch" .BranchName | Safe}}
{{$branchName := .BranchName | Str2html}}
{{.i18n.Tr "repo.editor.commit_directly_to_this_branch" $branchName | Safe}}
</label>
</div>
</div>

2
templates/repo/issue/view_title.tmpl

@ -28,7 +28,7 @@
{{if .Issue.PullRequest.HasMerged}}
{{ $mergedStr:= TimeSince .Issue.PullRequest.Merged $.Lang }}
<a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.Name}}</a>
<span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Safe}}</span>
<span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Str2html}}</span>
{{else}}
<a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a>
<span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span>

Loading…
Cancel
Save