Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-28 12:46:09 +01:00

#1905 Triming the issue title

This commit is contained in:
Unknwon 2015-11-06 11:17:46 -05:00
parent 6f929dcd9e
commit e7aabf70dc

View file

@ -393,7 +393,7 @@ func NewIssuePost(ctx *middleware.Context, form auth.CreateIssueForm) {
issue := &models.Issue{
RepoID: ctx.Repo.Repository.ID,
Index: repo.NextIssueIndex(),
Name: form.Title,
Name: strings.TrimSpace(form.Title),
PosterID: ctx.User.Id,
Poster: ctx.User,
MilestoneID: milestoneID,
@ -620,7 +620,7 @@ func UpdateIssueTitle(ctx *middleware.Context) {
return
}
issue.Name = ctx.Query("title")
issue.Name = ctx.QueryTrim("title")
if len(issue.Name) == 0 {
ctx.Error(204)
return