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 --- bridge/launchpad/import.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bridge/launchpad') 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, -- cgit