MM_22682_Centralize_ID_Validation (#14237)

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Shibasis Patel
2020-05-07 22:57:35 +05:30
коммит произвёл GitHub
родитель ef5ac519d9
Коммит 882b0324b5
36 изменённых файлов: 93 добавлений и 93 удалений

Просмотреть файл

@@ -23,7 +23,7 @@ func saveReaction(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if len(reaction.UserId) != 26 || len(reaction.PostId) != 26 || len(reaction.EmojiName) == 0 || len(reaction.EmojiName) > model.EMOJI_NAME_MAX_LENGTH {
if !model.IsValidId(reaction.UserId) || !model.IsValidId(reaction.PostId) || len(reaction.EmojiName) == 0 || len(reaction.EmojiName) > model.EMOJI_NAME_MAX_LENGTH {
c.Err = model.NewAppError("saveReaction", "api.reaction.save_reaction.invalid.app_error", nil, "", http.StatusBadRequest)
return
}