From 42dae399eb1d99be8941dc3e2b628b7c2850b9d9 Mon Sep 17 00:00:00 2001 From: 6543 <24977596+6543@users.noreply.github.com> Date: Fri, 29 Nov 2019 07:00:19 +0100 Subject: [PATCH] Fix max length check and limit in multiple repo forms (#9148) (#9204) * Fix input field max length for release, label and milestone forms * Add max length for isseu and PR title --- modules/auth/repo_form.go | 8 ++++---- templates/repo/issue/labels.tmpl | 12 ++++++------ templates/repo/issue/milestone_new.tmpl | 2 +- templates/repo/issue/new_form.tmpl | 2 +- templates/repo/issue/view_title.tmpl | 2 +- templates/repo/release/new.tmpl | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index 8d10fc157..a9985fdcb 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -499,9 +499,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 @@ -515,7 +515,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 956fc955a..176304278 100644 --- a/templates/repo/issue/labels.tmpl +++ b/templates/repo/issue/labels.tmpl @@ -17,16 +17,16 @@