Skip to content

Commit 395f65c

Browse files
authored
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.
1 parent 3219641 commit 395f65c

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

modules/repository/create.go

-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"os"
1111
"path"
1212
"strings"
13-
"unicode/utf8"
1413

1514
"code.gitea.io/gitea/models"
1615
activities_model "code.gitea.io/gitea/models/activities"
@@ -337,13 +336,6 @@ func CheckDaemonExportOK(ctx context.Context, repo *repo_model.Repository) error
337336
func UpdateRepository(ctx context.Context, repo *repo_model.Repository, visibilityChanged bool) (err error) {
338337
repo.LowerName = strings.ToLower(repo.Name)
339338

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-
347339
e := db.GetEngine(ctx)
348340

349341
if _, err = e.ID(repo.ID).AllCols().Update(repo); err != nil {

0 commit comments

Comments
 (0)