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 удалений

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

@@ -296,7 +296,7 @@ func executeCommand(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
if len(commandArgs.Command) <= 1 || strings.Index(commandArgs.Command, "/") != 0 || len(commandArgs.ChannelId) != 26 {
if len(commandArgs.Command) <= 1 || strings.Index(commandArgs.Command, "/") != 0 || !model.IsValidId(commandArgs.ChannelId) {
c.Err = model.NewAppError("executeCommand", "api.command.execute_command.start.app_error", nil, "", http.StatusBadRequest)
return
}