diff options
author | Wim <wim@42.be> | 2017-08-16 23:37:37 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-08-16 23:37:37 +0200 |
commit | b963f83c6a09da1eaf02eb9f269c6f5881a0c711 (patch) | |
tree | 5ec37162046349d23c627e9ee26fb70c1a6c4f08 /vendor/github.com/mattermost/platform/model/reaction.go | |
parent | f6297ebbb09611165a50a6cd15abf6499268cf86 (diff) | |
download | matterbridge-msglm-b963f83c6a09da1eaf02eb9f269c6f5881a0c711.tar.gz matterbridge-msglm-b963f83c6a09da1eaf02eb9f269c6f5881a0c711.tar.bz2 matterbridge-msglm-b963f83c6a09da1eaf02eb9f269c6f5881a0c711.zip |
Update mattermost vendor (3.7 => 4.1)
Diffstat (limited to 'vendor/github.com/mattermost/platform/model/reaction.go')
-rw-r--r-- | vendor/github.com/mattermost/platform/model/reaction.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/vendor/github.com/mattermost/platform/model/reaction.go b/vendor/github.com/mattermost/platform/model/reaction.go index afbdd1e8..3d334c21 100644 --- a/vendor/github.com/mattermost/platform/model/reaction.go +++ b/vendor/github.com/mattermost/platform/model/reaction.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved. +// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. package model @@ -6,6 +6,7 @@ package model import ( "encoding/json" "io" + "regexp" ) type Reaction struct { @@ -60,7 +61,9 @@ func (o *Reaction) IsValid() *AppError { return NewLocAppError("Reaction.IsValid", "model.reaction.is_valid.post_id.app_error", nil, "post_id="+o.PostId) } - if len(o.EmojiName) == 0 || len(o.EmojiName) > 64 { + validName := regexp.MustCompile(`^[a-zA-Z0-9\-\+_]+$`) + + if len(o.EmojiName) == 0 || len(o.EmojiName) > 64 || !validName.MatchString(o.EmojiName) { return NewLocAppError("Reaction.IsValid", "model.reaction.is_valid.emoji_name.app_error", nil, "emoji_name="+o.EmojiName) } |