Add MaxImageResolution config setting (#17941)

Этот коммит содержится в:
Claudio Costa
2021-08-12 17:43:10 +02:00
коммит произвёл GitHub
родитель e1b0644b0d
Коммит 96593580ae
11 изменённых файлов: 35 добавлений и 14 удалений

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

@@ -265,7 +265,7 @@ func (a *App) UploadData(c *request.Context, us *model.UploadSession, rd io.Read
// image post-processing
if info.IsImage() {
if limitErr := checkImageResolutionLimit(info.Width, info.Height); limitErr != nil {
if limitErr := checkImageResolutionLimit(info.Width, info.Height, *a.Config().FileSettings.MaxImageResolution); limitErr != nil {
return nil, model.NewAppError("uploadData", "app.upload.upload_data.large_image.app_error",
map[string]interface{}{"Filename": us.Filename, "Width": info.Width, "Height": info.Height}, "", http.StatusBadRequest)
}