Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/datatypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ _escape = function (s, type) {
// Scrub input for basic SQL injection protection
case 'sql':
ret = s.replace(/'/g, "''");
ret = ret.replace('\u0000', ' ');
break;
// Backslash-esc single quotes for use in M/R JS sourcecode str
case 'js':
Expand Down
9 changes: 9 additions & 0 deletions test/integration/adapters/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,15 @@ tests = {
});
});
}

, 'test escaping null characters': function (next) {
var person = model.Person.create({title: 'test \u0000!'});
person.save(function (err, data) {
if (err) { throw err; }
next();
});
}

};

module.exports = tests;