From fd76e0af72fe28b414ae3b5e8d3886e58561e57e Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Fri, 29 Mar 2024 20:12:44 +0700 Subject: [PATCH] feat(bots/discord): sanitize `BasicDatabase` inputs --- bots/discord/src/classes/Database.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bots/discord/src/classes/Database.ts b/bots/discord/src/classes/Database.ts index d0b7b54..7da2bb0 100644 --- a/bots/discord/src/classes/Database.ts +++ b/bots/discord/src/classes/Database.ts @@ -52,7 +52,7 @@ export class BasicDatabase> { } #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 === 'boolean') return value ? 1 : 0 if (value === null) return 'NULL'