diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-11-05 09:25:59 -0500 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-11-05 09:35:35 -0500 |
commit | c016a88c845ecaa4d219de43243efe07f0103c2d (patch) | |
tree | 9e3ab5b68b3c42c17f75450971401ab5a4ca1f44 /model/oauth.go | |
parent | 2c2775e22179942ff30bbabd9cc864012fee5fb5 (diff) | |
download | chat-c016a88c845ecaa4d219de43243efe07f0103c2d.tar.gz chat-c016a88c845ecaa4d219de43243efe07f0103c2d.tar.bz2 chat-c016a88c845ecaa4d219de43243efe07f0103c2d.zip |
Fixed string length checks for fields that can contain unicode characters
Diffstat (limited to 'model/oauth.go')
-rw-r--r-- | model/oauth.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/model/oauth.go b/model/oauth.go index 0320e7ec7..67825dd97 100644 --- a/model/oauth.go +++ b/model/oauth.go @@ -7,6 +7,7 @@ import ( "encoding/json" "fmt" "io" + "unicode/utf8" ) type OAuthApp struct { @@ -57,7 +58,7 @@ func (a *OAuthApp) IsValid() *AppError { return NewAppError("OAuthApp.IsValid", "Invalid homepage", "app_id="+a.Id) } - if len(a.Description) > 512 { + if utf8.RuneCountInString(a.Description) > 512 { return NewAppError("OAuthApp.IsValid", "Invalid description", "app_id="+a.Id) } |