From cb1b8fc3337f2e7611b342d077573312a62d5619 Mon Sep 17 00:00:00 2001 From: Carlos Tadeu Panato Junior Date: Mon, 12 Mar 2018 12:40:11 +0100 Subject: [MM-9725] Slack compatibility code in webhooks captures incorrect text (#8428) --- app/webhook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/webhook.go') diff --git a/app/webhook.go b/app/webhook.go index f3777ab48..abfc388b5 100644 --- a/app/webhook.go +++ b/app/webhook.go @@ -225,7 +225,7 @@ func SplitWebhookPost(post *model.Post) ([]*model.Post, *model.AppError) { func (a *App) CreateWebhookPost(userId string, channel *model.Channel, text, overrideUsername, overrideIconUrl string, props model.StringInterface, postType string, postRootId string) (*model.Post, *model.AppError) { // parse links into Markdown format - linkWithTextRegex := regexp.MustCompile(`<([^<\|]+)\|([^>]+)>`) + linkWithTextRegex := regexp.MustCompile(`<([^\n<\|>]+)\|([^\n>]+)>`) text = linkWithTextRegex.ReplaceAllString(text, "[${2}](${1})") post := &model.Post{UserId: userId, ChannelId: channel.Id, Message: text, Type: postType, RootId: postRootId} -- cgit v1.2.3-1-g7c22