summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 88c29ae43e..9333d1ee67 100644
--- a/models/user.go
+++ b/models/user.go
@@ -201,6 +201,13 @@ func VerifyUserActiveCode(code string) (user *User) {
// UpdateUser updates user's information.
func UpdateUser(user *User) (err error) {
+ if len(user.Location) > 255 {
+ user.Location = user.Location[:255]
+ }
+ if len(user.Website) > 255 {
+ user.Website = user.Website[:255]
+ }
+
_, err = orm.Id(user.Id).UseBool().Cols("website", "location").Update(user)
return err
}