From 51a2c85954e77068c6afbb4ca54159086220aefd Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 17 Apr 2021 17:40:11 +0200 Subject: make sure every text input is safe and validated fix #630 --- commands/comment_add.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'commands/comment_add.go') diff --git a/commands/comment_add.go b/commands/comment_add.go index 6caf4943..438e983a 100644 --- a/commands/comment_add.go +++ b/commands/comment_add.go @@ -5,6 +5,7 @@ import ( _select "github.com/MichaelMure/git-bug/commands/select" "github.com/MichaelMure/git-bug/input" + "github.com/MichaelMure/git-bug/util/text" ) type commentAddOptions struct { @@ -62,7 +63,7 @@ func runCommentAdd(env *Env, opts commentAddOptions, args []string) error { } } - _, err = b.AddComment(opts.message) + _, err = b.AddComment(text.Cleanup(opts.message)) if err != nil { return err } -- cgit