Skip to content

Commit

Permalink
Modify milestone search keywords to be case insensitive (#20266) (#20498
Browse files Browse the repository at this point in the history
)

* Modify milestone search keywords to be case insensitive (#20266)

Milestone search keywords are now sensitive, this modification is changed to insensitive

* Modify for #18437

Co-authored-by: Lunny Xiao <[email protected]>
  • Loading branch information
tyroneyeh and lunny authored Jul 27, 2022
1 parent bed13bf commit e0f35ea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion models/issues/milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/timeutil"
"code.gitea.io/gitea/modules/util"

"xorm.io/builder"
)
Expand Down Expand Up @@ -361,7 +362,11 @@ func (opts GetMilestonesOption) toCond() builder.Cond {
}

if len(opts.Name) != 0 {
cond = cond.And(builder.Like{"name", opts.Name})
if setting.Database.UseSQLite3 {
cond = cond.And(builder.Like{"UPPER(name)", util.ToUpperASCII(opts.Name)})
} else {
cond = cond.And(builder.Like{"UPPER(name)", strings.ToUpper(opts.Name)})
}
}

return cond
Expand Down

0 comments on commit e0f35ea

Please sign in to comment.