diff options
Diffstat (limited to 'vendor/github.com/mattermost/mattermost-server/v6/model/emoji.go')
-rw-r--r-- | vendor/github.com/mattermost/mattermost-server/v6/model/emoji.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vendor/github.com/mattermost/mattermost-server/v6/model/emoji.go b/vendor/github.com/mattermost/mattermost-server/v6/model/emoji.go index fd0e8ab3..4b30ee43 100644 --- a/vendor/github.com/mattermost/mattermost-server/v6/model/emoji.go +++ b/vendor/github.com/mattermost/mattermost-server/v6/model/emoji.go @@ -78,9 +78,12 @@ func (emoji *Emoji) IsValid() *AppError { } func IsValidEmojiName(name string) *AppError { - if name == "" || len(name) > EmojiNameMaxLength || !IsValidAlphaNumHyphenUnderscorePlus(name) || inSystemEmoji(name) { + if name == "" || len(name) > EmojiNameMaxLength || !IsValidAlphaNumHyphenUnderscorePlus(name) { return NewAppError("Emoji.IsValid", "model.emoji.name.app_error", nil, "", http.StatusBadRequest) } + if inSystemEmoji(name) { + return NewAppError("Emoji.IsValid", "model.emoji.system_emoji_name.app_error", nil, "", http.StatusBadRequest) + } return nil } |