Skip to content

Node.js based forum software built for the modern web

fix: use parameterized query for key lookup

Barış Soner Uşaklı6cca55e37f0b
diff --git a/src/database/postgres/main.js b/src/database/postgres/main.js
index c0838b45a0..5b3c7f7e9d 100644
--- a/src/database/postgres/main.js
+++ b/src/database/postgres/main.js
@@ -85,7 +85,8 @@ module.exports = function (module) {
text: `
SELECT o."_key"
FROM "legacy_object_live" o
- WHERE o."_key" LIKE '${match}'`,
+ WHERE o."_key" LIKE $1`,
+ values: [match],
});
return res.rows.map(r => r._key);