summaryrefslogtreecommitdiffstats
path: root/modules
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 /modules
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 'modules')
-rw-r--r--modules/structs/repo.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/structs/repo.go b/modules/structs/repo.go
index 6a5736898d..d3833105d7 100644
--- a/modules/structs/repo.go
+++ b/modules/structs/repo.go
@@ -111,7 +111,7 @@ type CreateRepoOption struct {
// unique: true
Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"`
// Description of the repository to create
- Description string `json:"description" binding:"MaxSize(255)"`
+ Description string `json:"description" binding:"MaxSize(2048)"`
// Whether the repository is private
Private bool `json:"private"`
// Label-Set to use
@@ -140,9 +140,9 @@ type EditRepoOption struct {
// unique: true
Name *string `json:"name,omitempty" binding:"OmitEmpty;AlphaDashDot;MaxSize(100);"`
// a short description of the repository.
- Description *string `json:"description,omitempty" binding:"MaxSize(255)"`
+ Description *string `json:"description,omitempty" binding:"MaxSize(2048)"`
// a URL with more information about the repository.
- Website *string `json:"website,omitempty" binding:"MaxSize(255)"`
+ Website *string `json:"website,omitempty" binding:"MaxSize(1024)"`
// either `true` to make the repository private or `false` to make it public.
// Note: you will get a 422 error if the organization restricts changing repository visibility to organization
// owners and a non-owner tries to change the value of private.
@@ -208,7 +208,7 @@ type GenerateRepoOption struct {
// Default branch of the new repository
DefaultBranch string `json:"default_branch"`
// Description of the repository to create
- Description string `json:"description" binding:"MaxSize(255)"`
+ Description string `json:"description" binding:"MaxSize(2048)"`
// Whether the repository is private
Private bool `json:"private"`
// include git content of default branch in template repo
@@ -316,7 +316,7 @@ type MigrateRepoOptions 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"`