Skip to content

Commit

Permalink
Escape the commit message on issues update (go-gitea#6901)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeripath committed May 10, 2019
1 parent c8fc7fc commit 78aaa3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion models/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package models
import (
"encoding/json"
"fmt"
"html"
"path"
"regexp"
"strconv"
Expand Down Expand Up @@ -532,7 +533,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, bra
}
refMarked[issue.ID] = true

message := fmt.Sprintf(`<a href="%s/commit/%s">%s</a>`, repo.Link(), c.Sha1, c.Message)
message := fmt.Sprintf(`<a href="%s/commit/%s">%s</a>`, repo.Link(), c.Sha1, html.EscapeString(c.Message))
if err = CreateRefComment(doer, repo, issue, message, c.Sha1); err != nil {
return err
}
Expand Down

0 comments on commit 78aaa3e

Please sign in to comment.