loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove unnecessary length check for repo's Description & Website (#21194)

Follows #21119

The manual length check doesn't make sense nowadays:
1. The length check is already done by form's `binding:MaxSize` (then the manual check is unnecessary)
2. The CreateRepository doesn't have such check (then the manual check is inconsistent)

So this PR removes these manual length checks.

authored by

wxiaoguang and committed by
GitHub
395f65c6 32196415

-8
-8
modules/repository/create.go
··· 10 10 "os" 11 11 "path" 12 12 "strings" 13 - "unicode/utf8" 14 13 15 14 "code.gitea.io/gitea/models" 16 15 activities_model "code.gitea.io/gitea/models/activities" ··· 336 335 // UpdateRepository updates a repository with db context 337 336 func UpdateRepository(ctx context.Context, repo *repo_model.Repository, visibilityChanged bool) (err error) { 338 337 repo.LowerName = strings.ToLower(repo.Name) 339 - 340 - if utf8.RuneCountInString(repo.Description) > 255 { 341 - repo.Description = string([]rune(repo.Description)[:255]) 342 - } 343 - if utf8.RuneCountInString(repo.Website) > 255 { 344 - repo.Website = string([]rune(repo.Website)[:255]) 345 - } 346 338 347 339 e := db.GetEngine(ctx) 348 340