Skip to content

Commit

Permalink
Escape the commit message on issues update (#6901) (#6902)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeripath authored May 10, 2019
1 parent c8fc7fc commit ebb8fa6
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 ebb8fa6

Please sign in to comment.