mirror of
https://github.com/BobbyWibowo/lolisafe.git
synced 2024-12-13 07:56:23 +00:00
Fix SQLite not understanding escape char
I honestly expected Knex.js would've already handled this
This commit is contained in:
parent
8bcee712ac
commit
0851d71688
@ -1236,8 +1236,8 @@ self.list = async (req, res) => {
|
||||
this.andWhere(function () {
|
||||
if (!filterObj.queries.text) return
|
||||
for (const pattern of filterObj.queries.text) {
|
||||
this.orWhere('name', 'like', pattern)
|
||||
this.orWhere('original', 'like', pattern)
|
||||
this.orWhereRaw('?? like ? escape ?', ['name', pattern, '\\'])
|
||||
this.orWhereRaw('?? like ? escape ?', ['original', pattern, '\\'])
|
||||
}
|
||||
})
|
||||
|
||||
@ -1245,8 +1245,8 @@ self.list = async (req, res) => {
|
||||
this.andWhere(function () {
|
||||
if (!filterObj.queries.exclude.text) return
|
||||
for (const pattern of filterObj.queries.exclude.text) {
|
||||
this.andWhere('name', 'not like', pattern)
|
||||
this.andWhere('original', 'not like', pattern)
|
||||
this.andWhereRaw('?? not like ? escape ?', ['name', pattern, '\\'])
|
||||
this.andWhereRaw('?? not like ? escape ?', ['original', pattern, '\\'])
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user