* 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 <xiaolunwen@gmail.com>
This commit is contained in:
parent
bed13bfa9e
commit
e0f35ea00f
1 changed files with 6 additions and 1 deletions
|
@ -15,6 +15,7 @@ import (
|
||||||
"code.gitea.io/gitea/modules/setting"
|
"code.gitea.io/gitea/modules/setting"
|
||||||
api "code.gitea.io/gitea/modules/structs"
|
api "code.gitea.io/gitea/modules/structs"
|
||||||
"code.gitea.io/gitea/modules/timeutil"
|
"code.gitea.io/gitea/modules/timeutil"
|
||||||
|
"code.gitea.io/gitea/modules/util"
|
||||||
|
|
||||||
"xorm.io/builder"
|
"xorm.io/builder"
|
||||||
)
|
)
|
||||||
|
@ -361,7 +362,11 @@ func (opts GetMilestonesOption) toCond() builder.Cond {
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(opts.Name) != 0 {
|
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
|
return cond
|
||||||
|
|
Reference in a new issue