Browse Source

models: sanitize user full name when update settings

pull/904/head
Unknwon 10 years ago
parent
commit
f706102890
  1. 2
      gogs.go
  2. 1
      models/user.go
  3. 2
      templates/.VERSION

2
gogs.go

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.5.12.0202 Beta" const APP_VER = "0.5.12.0204 Beta"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

1
models/user.go

@ -477,6 +477,7 @@ func UpdateUser(u *User) error {
} }
u.Avatar = avatar.HashEmail(u.AvatarEmail) u.Avatar = avatar.HashEmail(u.AvatarEmail)
u.FullName = base.Sanitizer.Sanitize(u.FullName)
_, err = x.Id(u.Id).AllCols().Update(u) _, err = x.Id(u.Id).AllCols().Update(u)
return err return err
} }

2
templates/.VERSION

@ -1 +1 @@
0.5.12.0202 Beta 0.5.12.0204 Beta
Loading…
Cancel
Save