From e1ce425b536632b34628e2750e665a4942ea25a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauris=20Buk=C5=A1is-Haberkorns?= Date: Sun, 24 Nov 2019 18:23:56 +0200 Subject: [PATCH 1/2] Fix input field max length for release, label and milestone forms --- modules/auth/repo_form.go | 8 ++++---- templates/repo/issue/labels.tmpl | 12 ++++++------ templates/repo/issue/milestone_new.tmpl | 2 +- templates/repo/release/new.tmpl | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index 2602dc42ebd9..d1c07338bd8c 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -505,9 +505,9 @@ func (f SubmitReviewForm) HasEmptyContent() bool { // NewReleaseForm form for creating release type NewReleaseForm struct { - TagName string `binding:"Required;GitRefName"` - Target string `form:"tag_target" binding:"Required"` - Title string `binding:"Required"` + TagName string `binding:"Required;GitRefName;MaxSize(255)"` + Target string `form:"tag_target" binding:"Required;MaxSize(255)"` + Title string `binding:"Required;MaxSize(255)"` Content string Draft string Prerelease bool @@ -521,7 +521,7 @@ func (f *NewReleaseForm) Validate(ctx *macaron.Context, errs binding.Errors) bin // EditReleaseForm form for changing release type EditReleaseForm struct { - Title string `form:"title" binding:"Required"` + Title string `form:"title" binding:"Required;MaxSize(255)"` Content string `form:"content"` Draft string `form:"draft"` Prerelease bool `form:"prerelease"` diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl index 956fc955a034..176304278fa6 100644 --- a/templates/repo/issue/labels.tmpl +++ b/templates/repo/issue/labels.tmpl @@ -17,16 +17,16 @@
- +
- +
- +
{{template "repo/issue/label_precolors"}} @@ -151,16 +151,16 @@
- +
- +
- +
{{template "repo/issue/label_precolors"}} diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl index 30a7d7ebbb3d..ea704c056145 100644 --- a/templates/repo/issue/milestone_new.tmpl +++ b/templates/repo/issue/milestone_new.tmpl @@ -26,7 +26,7 @@
- +
diff --git a/templates/repo/release/new.tmpl b/templates/repo/release/new.tmpl index cdead92b9d29..01af6edc1253 100644 --- a/templates/repo/release/new.tmpl +++ b/templates/repo/release/new.tmpl @@ -19,7 +19,7 @@ {{if .PageIsEditRelease}} {{.tag_name}}@{{.tag_target}} {{else}} - + @