|
@ -11,6 +11,7 @@ import ( |
|
|
"errors" |
|
|
"errors" |
|
|
"fmt" |
|
|
"fmt" |
|
|
"html/template" |
|
|
"html/template" |
|
|
|
|
|
"unicode/utf8" |
|
|
|
|
|
|
|
|
// Needed for jpeg support
|
|
|
// Needed for jpeg support
|
|
|
_ "image/jpeg" |
|
|
_ "image/jpeg" |
|
@ -1394,11 +1395,11 @@ func GetRepositoriesByForkID(forkID int64) ([]*Repository, error) { |
|
|
func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err error) { |
|
|
func updateRepository(e Engine, repo *Repository, visibilityChanged bool) (err error) { |
|
|
repo.LowerName = strings.ToLower(repo.Name) |
|
|
repo.LowerName = strings.ToLower(repo.Name) |
|
|
|
|
|
|
|
|
if len(repo.Description) > 255 { |
|
|
|
|
|
repo.Description = repo.Description[:255] |
|
|
|
|
|
|
|
|
if utf8.RuneCountInString(repo.Description) > 255 { |
|
|
|
|
|
repo.Description = string([]rune(repo.Description)[:255]) |
|
|
} |
|
|
} |
|
|
if len(repo.Website) > 255 { |
|
|
|
|
|
repo.Website = repo.Website[:255] |
|
|
|
|
|
|
|
|
if utf8.RuneCountInString(repo.Website) > 255 { |
|
|
|
|
|
repo.Website = string([]rune(repo.Website)[:255]) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if _, err = e.ID(repo.ID).AllCols().Update(repo); err != nil { |
|
|
if _, err = e.ID(repo.ID).AllCols().Update(repo); err != nil { |
|
|