summaryrefslogtreecommitdiffstats
path: root/routers/user
diff options
context:
space:
mode:
Diffstat (limited to 'routers/user')
-rw-r--r--routers/user/setting/profile.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/user/setting/profile.go b/routers/user/setting/profile.go
index 85c9c83fd1..ac5c4c97fb 100644
--- a/routers/user/setting/profile.go
+++ b/routers/user/setting/profile.go
@@ -127,6 +127,10 @@ func UpdateAvatarSetting(ctx *context.Context, form auth.AvatarForm, ctxUser *mo
}
defer fr.Close()
+ if form.Avatar.Size > setting.AvatarMaxFileSize {
+ return errors.New(ctx.Tr("settings.uploaded_avatar_is_too_big"))
+ }
+
data, err := ioutil.ReadAll(fr)
if err != nil {
return fmt.Errorf("ioutil.ReadAll: %v", err)