summaryrefslogtreecommitdiffstats
path: root/modules/notification
diff options
context:
space:
mode:
authormrsdizzie <info@mrsdizzie.com>2020-09-18 13:50:06 -0400
committerGitHub <noreply@github.com>2020-09-18 13:50:06 -0400
commit25ddf77b51a4095b589e7f34ef923f437f817da7 (patch)
tree3420b495fc44e6ce3ba1c20fd23f2729a0dc7d59 /modules/notification
parent54ae4485881664715d615037f1ab48d50044b0a0 (diff)
downloadgitea-25ddf77b51a4095b589e7f34ef923f437f817da7.tar.gz
gitea-25ddf77b51a4095b589e7f34ef923f437f817da7.zip
Fix panic when adding long comment (#12892)
Previous PR #12881 causes out of bounds panic by working on wrong string.
Diffstat (limited to 'modules/notification')
-rw-r--r--modules/notification/action/action.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/notification/action/action.go b/modules/notification/action/action.go
index 4a257b3618..f7078d3493 100644
--- a/modules/notification/action/action.go
+++ b/modules/notification/action/action.go
@@ -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
}