aboutsummaryrefslogtreecommitdiffstats
path: root/bug/label.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2021-04-17 19:40:01 +0200
committerGitHub <noreply@github.com>2021-04-17 19:40:01 +0200
commit6d1c9346cc5ff892f808a7e3dd3e01291e49a16d (patch)
tree9b424181369a67f69502a27186bd266a19a28506 /bug/label.go
parent62fb09a53cc626ac581f33b466a1cdf14eb6ed89 (diff)
parent51a2c85954e77068c6afbb4ca54159086220aefd (diff)
downloadgit-bug-6d1c9346cc5ff892f808a7e3dd3e01291e49a16d.tar.gz
Merge pull request #632 from MichaelMure/data-input-cleanup
make sure every text input is safe and validated
Diffstat (limited to 'bug/label.go')
-rw-r--r--bug/label.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/bug/label.go b/bug/label.go
index 9d1e99a7..79b5f591 100644
--- a/bug/label.go
+++ b/bug/label.go
@@ -4,7 +4,6 @@ import (
"crypto/sha256"
"fmt"
"image/color"
- "strings"
fcolor "github.com/fatih/color"
@@ -58,12 +57,8 @@ func (l Label) Validate() error {
return fmt.Errorf("empty")
}
- if strings.Contains(str, "\n") {
- return fmt.Errorf("should be a single line")
- }
-
- if !text.Safe(str) {
- return fmt.Errorf("not fully printable")
+ if !text.SafeOneLine(str) {
+ return fmt.Errorf("label has unsafe characters")
}
return nil