Skip to content

Commit 04c9f2b

Browse files
committed
Properly escape IN clause
1 parent 7685c2c commit 04c9f2b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/features.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function executeQuery(query, callback) {
3232

3333
function getById(query, callback) {
3434
const ids = query.id.constructor === Array ? query.id : [query.id];
35-
const getQuery = `SELECT ${buildQueryColumns(query)} FROM features WHERE id IN (${escapeSql(ids.join(','))})`;
35+
const getQuery = `SELECT ${buildQueryColumns(query)} FROM features WHERE id IN (${ids.map(escapeSql).join(',')})`;
3636
executeQuery(getQuery, (err, rows) => {
3737
if (err) return callback(err);
3838
if (!rows || rows.length === 0) return callback(null, null);

0 commit comments

Comments
 (0)