Skip to content

Commit 34df39d

Browse files
committed
Do not permanently change the values of the 'val' array by escaping each element inside it
1 parent 70a5b36 commit 34df39d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/sqlite3db.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,11 @@ SQLiteDB.prototype.toDatabase = function (prop, val) {
317317
return this.toDatabase(prop, val[0]) + ' AND ' + this.toDatabase(prop, val[1]);
318318
}
319319
if (operator === 'inq' || operator === 'nin') {
320+
var newVal = [];
320321
for (var i = 0; i < val.length; i++) {
321-
val[i] = escape(val[i]);
322+
newVal[i] = escape(val[i]);
322323
}
323-
return val.join(',');
324+
return newVal.join(',');
324325
}
325326
return this.toDatabase(prop, val);
326327
}

0 commit comments

Comments
 (0)