Skip to content

Commit 78aaa3e

Browse files
committed
Escape the commit message on issues update (go-gitea#6901)
1 parent c8fc7fc commit 78aaa3e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

models/action.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package models
77
import (
88
"encoding/json"
99
"fmt"
10+
"html"
1011
"path"
1112
"regexp"
1213
"strconv"
@@ -532,7 +533,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, bra
532533
}
533534
refMarked[issue.ID] = true
534535

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

0 commit comments

Comments
 (0)