File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import (
11
11
"errors"
12
12
"fmt"
13
13
"html/template"
14
+ "unicode/utf8"
14
15
15
16
// Needed for jpeg support
16
17
_ "image/jpeg"
@@ -1384,11 +1385,11 @@ func GetRepositoriesByForkID(forkID int64) ([]*Repository, error) {
1384
1385
func updateRepository (e Engine , repo * Repository , visibilityChanged bool ) (err error ) {
1385
1386
repo .LowerName = strings .ToLower (repo .Name )
1386
1387
1387
- if len (repo .Description ) > 255 {
1388
- repo .Description = repo .Description [:255 ]
1388
+ if utf8 . RuneCountInString (repo .Description ) > 255 {
1389
+ repo .Description = string ([] rune ( repo .Description ) [:255 ])
1389
1390
}
1390
- if len (repo .Website ) > 255 {
1391
- repo .Website = repo .Website [:255 ]
1391
+ if utf8 . RuneCountInString (repo .Website ) > 255 {
1392
+ repo .Website = string ([] rune ( repo .Website ) [:255 ])
1392
1393
}
1393
1394
1394
1395
if _ , err = e .ID (repo .ID ).AllCols ().Update (repo ); err != nil {
You can’t perform that action at this time.
0 commit comments