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"
@@ -1394,11 +1395,11 @@ func GetRepositoriesByForkID(forkID int64) ([]*Repository, error) {
1394
1395
func updateRepository (e Engine , repo * Repository , visibilityChanged bool ) (err error ) {
1395
1396
repo .LowerName = strings .ToLower (repo .Name )
1396
1397
1397
- if len (repo .Description ) > 255 {
1398
- repo .Description = repo .Description [:255 ]
1398
+ if utf8 . RuneCountInString (repo .Description ) > 255 {
1399
+ repo .Description = string ([] rune ( repo .Description )) [:255 ]
1399
1400
}
1400
- if len (repo .Website ) > 255 {
1401
- repo .Website = repo .Website [:255 ]
1401
+ if utf8 . RuneCountInString (repo .Website ) > 255 {
1402
+ repo .Website = string ([] rune ( repo .Website )) [:255 ]
1402
1403
}
1403
1404
1404
1405
if _ , err = e .ID (repo .ID ).AllCols ().Update (repo ); err != nil {
You can’t perform that action at this time.
0 commit comments