Explorar el Código

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 hace 3 años
padre
commit
23aae3274a
No account linked to committer's email address
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1
    1
      modules/notification/action/action.go

+ 1
- 1
modules/notification/action/action.go Ver fichero

@@ -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
}

Cargando…
Cancelar
Guardar