From e382bca610191f4fc0880bf198e18357058b9548 Mon Sep 17 00:00:00 2001 From: Peter Jaszkowiak Date: Sat, 15 Apr 2017 04:22:28 -0600 Subject: [PATCH] Fix tests --- src/socket.io/admin/rooms.js | 2 +- src/socket.io/posts/tools.js | 1 - src/socket.io/topics/tools.js | 1 - src/topics/data.js | 4 ++-- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/socket.io/admin/rooms.js b/src/socket.io/admin/rooms.js index f7a16bf85d..70b908d4dc 100644 --- a/src/socket.io/admin/rooms.js +++ b/src/socket.io/admin/rooms.js @@ -5,7 +5,7 @@ var async = require('async'); var os = require('os'); var nconf = require('nconf'); var winston = require('winston'); -var validator = require('validator'); + var topics = require('../../topics'); var pubsub = require('../../pubsub'); diff --git a/src/socket.io/posts/tools.js b/src/socket.io/posts/tools.js index 8d7a91ae9a..c1ad05b119 100644 --- a/src/socket.io/posts/tools.js +++ b/src/socket.io/posts/tools.js @@ -1,7 +1,6 @@ 'use strict'; var async = require('async'); -var validator = require('validator'); var posts = require('../../posts'); var topics = require('../../topics'); diff --git a/src/socket.io/topics/tools.js b/src/socket.io/topics/tools.js index e08b31e6e4..7302a5ad04 100644 --- a/src/socket.io/topics/tools.js +++ b/src/socket.io/topics/tools.js @@ -1,7 +1,6 @@ 'use strict'; var async = require('async'); -var validator = require('validator'); var topics = require('../../topics'); var events = require('../../events'); diff --git a/src/topics/data.js b/src/topics/data.js index 3a2a6e75d0..d0a6208632 100644 --- a/src/topics/data.js +++ b/src/topics/data.js @@ -12,7 +12,7 @@ function escapeTitle(topicData) { return; } if (topicData.title) { - topicData.title = translator.escape(validator.escape(topicData.title)); + topicData.title = translator.escape(validator.escape(topicData.title.toString())); } if (topicData.titleRaw) { topicData.titleRaw = translator.escape(topicData.titleRaw); @@ -27,7 +27,7 @@ module.exports = function (Topics) { } if (field === 'title') { - value = translator.escape(validator.escape(value)); + value = translator.escape(validator.escape(String(value))); } callback(null, value); });