Skip to content

Commit 58e9cad

Browse files
committed
don't sanitize numerical values
1 parent da7a313 commit 58e9cad

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/routes/projects/create.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ module.exports = [
7979
external: null,
8080
utm: null,
8181
});
82-
traverse(project).forEach(function (x) {
83-
if (this.isLeaf) this.update(req.sanitize(x));
82+
traverse(project).forEach((x) => {
83+
if (this.isLeaf && typeof x === 'string') this.update(req.sanitize(x));
8484
});
8585
// override values
8686
_.assign(project, {

src/routes/projects/update.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ module.exports = [
122122
const projectId = _.parseInt(req.params.projectId);
123123
// prune any fields that cannot be updated directly
124124
updatedProps = _.omit(updatedProps, ['createdBy', 'createdAt', 'updatedBy', 'updatedAt', 'id']);
125-
traverse(updatedProps).forEach(function (x) {
126-
if (this.isLeaf) this.update(req.sanitize(x));
125+
traverse(updatedProps).forEach((x) => {
126+
if (this.isLeaf && typeof x === 'string') this.update(req.sanitize(x));
127127
});
128128
let previousValue;
129129
models.sequelize.transaction(() => models.Project.findOne({

0 commit comments

Comments
 (0)