From f706102890af33c14aa9afc7e62a4c2dd52bd2a4 Mon Sep 17 00:00:00 2001
From: Unknwon <joe2010xtmf@163.com>
Date: Wed, 4 Feb 2015 20:04:01 -0500
Subject: [PATCH] models: sanitize user full name when update settings

---
 gogs.go            | 2 +-
 models/user.go     | 1 +
 templates/.VERSION | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gogs.go b/gogs.go
index 1f0f15b8b..5e69bd68e 100644
--- a/gogs.go
+++ b/gogs.go
@@ -17,7 +17,7 @@ import (
 	"github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.5.12.0202 Beta"
+const APP_VER = "0.5.12.0204 Beta"
 
 func init() {
 	runtime.GOMAXPROCS(runtime.NumCPU())
diff --git a/models/user.go b/models/user.go
index f16fbca34..2da0881c8 100644
--- a/models/user.go
+++ b/models/user.go
@@ -477,6 +477,7 @@ func UpdateUser(u *User) error {
 	}
 	u.Avatar = avatar.HashEmail(u.AvatarEmail)
 
+	u.FullName = base.Sanitizer.Sanitize(u.FullName)
 	_, err = x.Id(u.Id).AllCols().Update(u)
 	return err
 }
diff --git a/templates/.VERSION b/templates/.VERSION
index aa8ee543a..40246b9ec 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.5.12.0202 Beta
\ No newline at end of file
+0.5.12.0204 Beta
\ No newline at end of file