summaryrefslogtreecommitdiffstats
path: root/app/webhook.go
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2018-03-12 12:40:11 +0100
committerJoram Wilander <jwawilander@gmail.com>2018-03-12 07:40:11 -0400
commitcb1b8fc3337f2e7611b342d077573312a62d5619 (patch)
tree445806a0e52a30d170ed82d6673dc50d031e6153 /app/webhook.go
parent46fea093c8d77da3f3a6e5417632ba686eef8092 (diff)
downloadchat-cb1b8fc3337f2e7611b342d077573312a62d5619.tar.gz
chat-cb1b8fc3337f2e7611b342d077573312a62d5619.tar.bz2
chat-cb1b8fc3337f2e7611b342d077573312a62d5619.zip
[MM-9725] Slack compatibility code in webhooks captures incorrect text (#8428)
Diffstat (limited to 'app/webhook.go')
-rw-r--r--app/webhook.go2
1 files changed, 1 insertions, 1 deletions
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}