aboutsummaryrefslogtreecommitdiffstats
path: root/commands/add.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-04-17 17:40:11 +0200
committerMichael Muré <batolettre@gmail.com>2021-04-17 17:40:11 +0200
commit51a2c85954e77068c6afbb4ca54159086220aefd (patch)
tree9b424181369a67f69502a27186bd266a19a28506 /commands/add.go
parent62fb09a53cc626ac581f33b466a1cdf14eb6ed89 (diff)
downloadgit-bug-51a2c85954e77068c6afbb4ca54159086220aefd.tar.gz
make sure every text input is safe and validated
fix #630
Diffstat (limited to 'commands/add.go')
-rw-r--r--commands/add.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/commands/add.go b/commands/add.go
index 17fbbc93..ad3b164b 100644
--- a/commands/add.go
+++ b/commands/add.go
@@ -4,6 +4,7 @@ import (
"github.com/spf13/cobra"
"github.com/MichaelMure/git-bug/input"
+ "github.com/MichaelMure/git-bug/util/text"
)
type addOptions struct {
@@ -60,7 +61,10 @@ func runAdd(env *Env, opts addOptions) error {
}
}
- b, _, err := env.backend.NewBug(opts.title, opts.message)
+ b, _, err := env.backend.NewBug(
+ text.CleanupOneLine(opts.title),
+ text.Cleanup(opts.message),
+ )
if err != nil {
return err
}