diff --git a/README.md b/README.md index 3392416..adc098e 100755 --- a/README.md +++ b/README.md @@ -45,6 +45,10 @@ A node query builder for various SQL databases, based on CodeIgniter's query bui // Database module result handling }); +### Security notes +As of version 2, `where` and `having` type methods parse the values passed to look for function calls. While values passed are still passed as query parameters, take care to avoid passing these kinds of methods unfiltered input. SQL function arguments are not currently parsed, so they need to be properly escaped for the current database. + + ### Additional help * Generated documentation is in the docs/ folder diff --git a/docs/adapter.js.html b/docs/adapter.js.html index cd0cfef..26fdab5 100644 --- a/docs/adapter.js.html +++ b/docs/adapter.js.html @@ -92,15 +92,6 @@ module.exports = { */ execute: function(sql, params, callback) { throw new Error("Correct adapter not defined for query execution"); - }, - - /** - * Close the connection that is open on the current adapter - * - * @return void - */ - close: function() { - throw new Error("Close method not defined for the current adapter"); } }; diff --git a/docs/driver.js.html b/docs/driver.js.html index 887d66c..e9c5d08 100644 --- a/docs/driver.js.html +++ b/docs/driver.js.html @@ -99,8 +99,6 @@ var d = { * @private */ _quote: function(str) { - //if (/[0-9]+|\'(.*?)\'/ig.test(str)) return str; - return (helpers.isString(str) && ! (str.startsWith(d.identifierChar) || str.endsWith(d.identifierChar))) ? d.identifierChar + str + d.identifierChar : str; @@ -152,12 +150,6 @@ var d = { return str.map(d.quoteIdentifiers); } -if ( ! helpers.isString(str)) -{ - console.error(str); - return str; -} - // Handle commas if (str.contains(',')) { diff --git a/docs/index.html b/docs/index.html index fd27b9d..2c6d6b1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -130,7 +130,8 @@ query.select('foo') .limit(2, 3) .get(function(/* Adapter dependent arguments */) { // Database module result handling - });

Additional help