mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-16 08:04:45 -04:00
Update to remove null byte before saving to DB and remove null byte on changes
This commit is contained in:
parent
c3a96ff112
commit
d9e19b6029
4 changed files with 42 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue