Skip and warn on emoji import when name conflicts with system emoji (#19516)
This changes import behavior related to emoji imports when the name conflicts with the name of a system emoji. Previously, the import would fail, but now a warning is logged and the conflicting emoji is skipped.
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
40f48432a6
Коммит
03d059bd2a
@@ -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
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user