Skip to content

Commit eba5945

Browse files
committed
some fixes
1 parent 4c67925 commit eba5945

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

routers/api/v1/user/user.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
"strings"
99

1010
"github.com/Unknwon/com"
11+
"github.com/gogits/gogs/pkg/markup"
1112

1213
api "code.gitea.io/sdk/gitea"
1314

@@ -50,7 +51,7 @@ func Search(ctx *context.APIContext) {
5051
ID: users[i].ID,
5152
UserName: users[i].Name,
5253
AvatarURL: users[i].AvatarLink(),
53-
FullName: users[i].FullName,
54+
FullName: markup.Sanitize(users[i].FullName),
5455
}
5556
if ctx.IsSigned {
5657
results[i].Email = users[i].Email

templates/repo/editor/commit_form.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
<input type="radio" class="js-quick-pull-choice-option" name="commit_choice" value="direct" {{if eq .commit_choice "direct"}}checked{{end}}>
1515
<label>
1616
<i class="octicon octicon-git-commit" height="16" width="14"></i>
17-
{{.i18n.Tr "repo.editor.commit_directly_to_this_branch" .BranchName | Safe}}
17+
{{$branchName := .BranchName | Str2html}}
18+
{{.i18n.Tr "repo.editor.commit_directly_to_this_branch" $branchName | Safe}}
1819
</label>
1920
</div>
2021
</div>

templates/repo/issue/view_title.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
{{if .Issue.PullRequest.HasMerged}}
2929
{{ $mergedStr:= TimeSince .Issue.PullRequest.Merged $.Lang }}
3030
<a {{if gt .Issue.PullRequest.Merger.ID 0}}href="{{.Issue.PullRequest.Merger.HomeLink}}"{{end}}>{{.Issue.PullRequest.Merger.Name}}</a>
31-
<span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Safe}}</span>
31+
<span class="pull-desc">{{$.i18n.Tr "repo.pulls.merged_title_desc" .NumCommits .HeadTarget .BaseTarget $mergedStr | Str2html}}</span>
3232
{{else}}
3333
<a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a>
3434
<span class="pull-desc">{{$.i18n.Tr "repo.pulls.title_desc" .NumCommits .HeadTarget .BaseTarget | Str2html}}</span>

0 commit comments

Comments
 (0)