summaryrefslogtreecommitdiffstats
path: root/model/team.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2015-11-05 10:23:27 -0500
committerJoram Wilander <jwawilander@gmail.com>2015-11-05 10:23:27 -0500
commitd89e970343156c26f609a441e42bfc6bad41fdf8 (patch)
tree9e3ab5b68b3c42c17f75450971401ab5a4ca1f44 /model/team.go
parent2c2775e22179942ff30bbabd9cc864012fee5fb5 (diff)
parentc016a88c845ecaa4d219de43243efe07f0103c2d (diff)
downloadchat-d89e970343156c26f609a441e42bfc6bad41fdf8.tar.gz
chat-d89e970343156c26f609a441e42bfc6bad41fdf8.tar.bz2
chat-d89e970343156c26f609a441e42bfc6bad41fdf8.zip
Merge pull request #1312 from hmhealey/plt592
PLT-592 Correctly measure the length of unicode strings
Diffstat (limited to 'model/team.go')
-rw-r--r--model/team.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/model/team.go b/model/team.go
index 5c9cf5a26..e7dde4766 100644
--- a/model/team.go
+++ b/model/team.go
@@ -9,6 +9,7 @@ import (
"io"
"regexp"
"strings"
+ "unicode/utf8"
)
const (
@@ -122,7 +123,7 @@ func (o *Team) IsValid(restrictTeamNames bool) *AppError {
return NewAppError("Team.IsValid", "Invalid email", "id="+o.Id)
}
- if len(o.DisplayName) == 0 || len(o.DisplayName) > 64 {
+ if utf8.RuneCountInString(o.DisplayName) == 0 || utf8.RuneCountInString(o.DisplayName) > 64 {
return NewAppError("Team.IsValid", "Invalid name", "id="+o.Id)
}