aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/launchpad
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 /bridge/launchpad
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 'bridge/launchpad')
-rw-r--r--bridge/launchpad/import.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/bridge/launchpad/import.go b/bridge/launchpad/import.go
index 6b5667ba..01f6e53b 100644
--- a/bridge/launchpad/import.go
+++ b/bridge/launchpad/import.go
@@ -9,6 +9,7 @@ import (
"github.com/MichaelMure/git-bug/bug"
"github.com/MichaelMure/git-bug/cache"
"github.com/MichaelMure/git-bug/entity"
+ "github.com/MichaelMure/git-bug/util/text"
)
type launchpadImporter struct {
@@ -83,8 +84,8 @@ func (li *launchpadImporter) ImportAll(ctx context.Context, repo *cache.RepoCach
b, _, err = repo.NewBugRaw(
owner,
createdAt.Unix(),
- lpBug.Title,
- lpBug.Description,
+ text.CleanupOneLine(lpBug.Title),
+ text.Cleanup(lpBug.Description),
nil,
map[string]string{
core.MetaKeyOrigin: target,
@@ -133,7 +134,7 @@ func (li *launchpadImporter) ImportAll(ctx context.Context, repo *cache.RepoCach
op, err := b.AddCommentRaw(
owner,
createdAt.Unix(),
- lpMessage.Content,
+ text.Cleanup(lpMessage.Content),
nil,
map[string]string{
metaKeyLaunchpadID: lpMessage.ID,