Update to remove null byte before saving to DB and remove null byte on changes

This commit is contained in:
Wu Cheng-Han 2017-01-02 11:05:05 +08:00
parent c3a96ff112
commit d9e19b6029
4 changed files with 42 additions and 7 deletions

View file

@ -20,6 +20,13 @@ if (config.dburl)
else
sequelize = new Sequelize(dbconfig.database, dbconfig.username, dbconfig.password, dbconfig);
// [Postgres] Handling NULL bytes
// https://github.com/sequelize/sequelize/issues/6485
function stripNullByte(value) {
return value ? value.replace(/\u0000/g, "") : value;
}
sequelize.stripNullByte = stripNullByte;
var db = {};
fs