Fix strip null byte in model should cast to string to use replace function

This commit is contained in:
Wu Cheng-Han 2017-03-15 22:12:24 +08:00
parent f55a4b8497
commit 4a1d08c653

View file

@ -23,6 +23,7 @@ if (config.dburl) {
// [Postgres] Handling NULL bytes // [Postgres] Handling NULL bytes
// https://github.com/sequelize/sequelize/issues/6485 // https://github.com/sequelize/sequelize/issues/6485
function stripNullByte (value) { function stripNullByte (value) {
value = '' + value
return value ? value.replace(/\u0000/g, '') : value return value ? value.replace(/\u0000/g, '') : value
} }
sequelize.stripNullByte = stripNullByte sequelize.stripNullByte = stripNullByte