MM-41728: Validate emoji size in app while importing (#20325)
* MM-41728: Validate emoji size in app on import * use NotNil instead of Error for AppErr Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c975fdc982
Коммит
1f6e2fe846
@@ -1867,7 +1867,8 @@ func (a *App) importEmoji(data *EmojiImportData, dryRun bool) *model.AppError {
|
||||
}
|
||||
defer file.Close()
|
||||
|
||||
if _, err := a.WriteFile(file, getEmojiImagePath(emoji.Id)); err != nil {
|
||||
reader := utils.NewLimitedReaderWithError(file, MaxEmojiFileSize)
|
||||
if _, err := a.WriteFile(reader, getEmojiImagePath(emoji.Id)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user