1
0
Fork 0
forked from forgejo/forgejo

Update xorm to latest version (#1651)

* Update xorm to latest version

* Update xorm/builder
This commit is contained in:
Lauris BH 2017-05-02 03:50:33 +03:00 committed by Lunny Xiao
parent 0144817971
commit 3792867955
18 changed files with 251 additions and 141 deletions

View file

@ -16,7 +16,12 @@ func (like Like) WriteTo(w Writer) error {
if _, err := fmt.Fprintf(w, "%s LIKE ?", like[0]); err != nil {
return err
}
w.Append("%" + like[1] + "%")
// FIXME: if use other regular express, this will be failed. but for compitable, keep this
if like[1][0] == '%' || like[1][len(like[1])-1] == '%' {
w.Append(like[1])
} else {
w.Append("%" + like[1] + "%")
}
return nil
}