diff --git a/src/graph.js b/src/graph.js index 1fcec75b4f..7d82838d4c 100644 --- a/src/graph.js +++ b/src/graph.js @@ -63,6 +63,7 @@ class Graph { let paramType = typeof paramValue; if (paramType == "string") { let strValue = ""; + paramValue = paramValue.replace(/[\\"']/g, '\\$&'); if (paramValue[0] != '"') strValue += '"'; strValue += paramValue; if (paramValue[paramValue.length - 1] != '"') strValue += '"'; diff --git a/test/redisGraphAPITest.js b/test/redisGraphAPITest.js index 371d3a7f75..22a8095f4b 100644 --- a/test/redisGraphAPITest.js +++ b/test/redisGraphAPITest.js @@ -412,6 +412,7 @@ describe("RedisGraphAPI Test", () => { [1, 2, 3], ["1", "2", "3"], null, + 'test"abc' ]; let promises = []; for (var i = 0; i < params.length; i++) {