Przeglądaj źródła

Fix panic when adding long comment (#12892) (#12894)

Previous PR #12881 causes out of bounds panic by working on wrong string.
tags/v1.12.5
mrsdizzie 3 lat temu
rodzic
commit
23aae3274a
No account linked to committer's email address
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1
    1
      modules/notification/action/action.go

+ 1
- 1
modules/notification/action/action.go Wyświetl plik

@@ -102,7 +102,7 @@ func (a *actionNotifier) NotifyCreateIssueComment(doer *models.User, repo *model
content := ""

if len(comment.Content) > 200 {
content = content[:strings.LastIndex(comment.Content[0:200], " ")] + "…"
content = comment.Content[:strings.LastIndex(comment.Content[0:200], " ")] + "…"
} else {
content = comment.Content
}

Ładowanie…
Anuluj
Zapisz