aboutsummaryrefslogtreecommitdiffstats
path: root/services/forms
diff options
context:
space:
mode:
authorJakobDev <jakobdev@gmx.de>2022-09-16 09:19:16 +0200
committerGitHub <noreply@github.com>2022-09-16 15:19:16 +0800
commit8351172b6e5221290dc5b2c81e159e2eec0b43c8 (patch)
treef38555c165d2ea00c0c632f83b1e50e2a21c9aa4 /services/forms
parentbdc4c4c379df517ff24177f948b22906787faf6a (diff)
downloadgitea-8351172b6e5221290dc5b2c81e159e2eec0b43c8.tar.gz
gitea-8351172b6e5221290dc5b2c81e159e2eec0b43c8.zip
Limit length of repo description and repo url input fields (#21119)
Both allow only limited characters. If you input more, you will get a error message. So it make sense to limit the characters of the input fields. Slightly relax the MaxSize of repo's Description and Website
Diffstat (limited to 'services/forms')
-rw-r--r--services/forms/repo_form.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go
index 4eb20d297f..c1e9cb3197 100644
--- a/services/forms/repo_form.go
+++ b/services/forms/repo_form.go
@@ -34,7 +34,7 @@ type CreateRepoForm struct {
UID int64 `binding:"Required"`
RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"`
Private bool
- Description string `binding:"MaxSize(255)"`
+ Description string `binding:"MaxSize(2048)"`
DefaultBranch string `binding:"GitRefName;MaxSize(100)"`
AutoInit bool
Gitignores string
@@ -76,7 +76,7 @@ type MigrateRepoForm struct {
LFS bool `json:"lfs"`
LFSEndpoint string `json:"lfs_endpoint"`
Private bool `json:"private"`
- Description string `json:"description" binding:"MaxSize(255)"`
+ Description string `json:"description" binding:"MaxSize(2048)"`
Wiki bool `json:"wiki"`
Milestones bool `json:"milestones"`
Labels bool `json:"labels"`
@@ -116,8 +116,8 @@ func ParseRemoteAddr(remoteAddr, authUsername, authPassword string) (string, err
// RepoSettingForm form for changing repository settings
type RepoSettingForm struct {
RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"`
- Description string `binding:"MaxSize(255)"`
- Website string `binding:"ValidUrl;MaxSize(255)"`
+ Description string `binding:"MaxSize(2048)"`
+ Website string `binding:"ValidUrl;MaxSize(1024)"`
Interval string
MirrorAddress string
MirrorUsername string