Skip to content

Commit 100c472

Browse files
authored
Merge branch 'master' into fix-go-gitea#5454-improve-api-repos-search
2 parents 96128e4 + d64a646 commit 100c472

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

models/action.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ package models
88
import (
99
"encoding/json"
1010
"fmt"
11+
"html"
1112
"path"
1213
"regexp"
1314
"strconv"
@@ -580,7 +581,7 @@ func UpdateIssuesCommit(doer *User, repo *Repository, commits []*PushCommit, bra
580581
}
581582
refMarked[issue.ID] = true
582583

583-
message := fmt.Sprintf(`<a href="%s/commit/%s">%s</a>`, repo.Link(), c.Sha1, c.Message)
584+
message := fmt.Sprintf(`<a href="%s/commit/%s">%s</a>`, repo.Link(), c.Sha1, html.EscapeString(c.Message))
584585
if err = CreateRefComment(doer, refRepo, issue, message, c.Sha1); err != nil {
585586
return err
586587
}

models/webhook_telegram.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
"strings"
1112

1213
"code.gitea.io/gitea/modules/git"
@@ -169,7 +170,7 @@ func getTelegramIssuesPayload(p *api.IssuePayload) (*TelegramPayload, error) {
169170

170171
func getTelegramIssueCommentPayload(p *api.IssueCommentPayload) (*TelegramPayload, error) {
171172
url := fmt.Sprintf("%s/issues/%d#%s", p.Repository.HTMLURL, p.Issue.Index, CommentHashTag(p.Comment.ID))
172-
title := fmt.Sprintf(`<a href="%s">#%d %s</a>`, url, p.Issue.Index, p.Issue.Title)
173+
title := fmt.Sprintf(`<a href="%s">#%d %s</a>`, url, p.Issue.Index, html.EscapeString(p.Issue.Title))
173174
var text string
174175
switch p.Action {
175176
case api.HookIssueCommentCreated:

modules/ssh/ssh.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,6 @@ func handleServerConn(keyID string, chans <-chan ssh.NewChannel) {
5252
for req := range in {
5353
payload := cleanCommand(string(req.Payload))
5454
switch req.Type {
55-
case "env":
56-
args := strings.Split(strings.Replace(payload, "\x00", "", -1), "\v")
57-
if len(args) != 2 {
58-
log.Warn("SSH: Invalid env arguments: '%#v'", args)
59-
continue
60-
}
61-
args[0] = strings.TrimLeft(args[0], "\x04")
62-
_, _, err := com.ExecCmdBytes("env", args[0]+"="+args[1])
63-
if err != nil {
64-
log.Error("env: %v", err)
65-
return
66-
}
6755
case "exec":
6856
cmdName := strings.TrimLeft(payload, "'()")
6957
log.Trace("SSH: Payload: %v", cmdName)

0 commit comments

Comments
 (0)