modules/base: add RenderCommitMessage with XSS-safe and special links

- update russian locale
This commit is contained in:
Unknwon 2015-01-30 18:05:20 -05:00
parent 9803f84c88
commit 37fcc8daf2
12 changed files with 27 additions and 21 deletions

View file

@ -37,7 +37,7 @@ func RenderIssueLinks(oldCommits *list.List, repoLink string) *list.List {
newCommits := list.New()
for e := oldCommits.Front(); e != nil; e = e.Next() {
c := e.Value.(*git.Commit)
c.CommitMessage = string(base.RenderIssueIndexPattern([]byte(c.CommitMessage), repoLink))
c.CommitMessage = c.CommitMessage
newCommits.PushBack(c)
}
return newCommits
@ -206,7 +206,7 @@ func Diff(ctx *middleware.Context) {
commitId := ctx.Repo.CommitId
commit := ctx.Repo.Commit
commit.CommitMessage = string(base.RenderIssueIndexPattern([]byte(commit.CommitMessage), ctx.Repo.RepoLink))
commit.CommitMessage = commit.CommitMessage
diff, err := models.GetDiffCommit(models.RepoPath(userName, repoName),
commitId, setting.Git.MaxGitDiffLines)
if err != nil {