mirror of
https://github.com/ReVanced/revanced-bots.git
synced 2026-01-18 00:33:59 +00:00
feat(bots/discord): sanitize BasicDatabase inputs
This commit is contained in:
@@ -52,7 +52,7 @@ export class BasicDatabase<T extends Record<string, BasicSQLBindings>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#encodeValue(value: unknown) {
|
#encodeValue(value: unknown) {
|
||||||
if (typeof value === 'string') return `'${value}'`
|
if (typeof value === 'string') return `'${value.replaceAll("'", "\\'")}'`
|
||||||
if (typeof value === 'number') return value
|
if (typeof value === 'number') return value
|
||||||
if (typeof value === 'boolean') return value ? 1 : 0
|
if (typeof value === 'boolean') return value ? 1 : 0
|
||||||
if (value === null) return 'NULL'
|
if (value === null) return 'NULL'
|
||||||
|
|||||||
Reference in New Issue
Block a user