diff --git a/src/routes/index.js b/src/routes/index.js index 0cd9a65d9e..da96a2757d 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -199,7 +199,7 @@ module.exports = function(app, middleware) { app.use(relativePath, pluginRouter); app.use(relativePath, pageRouter); app.use(relativePath, authRouter); - + if (process.env.NODE_ENV === 'development') { require('./debug')(app, middleware, controllers); } diff --git a/src/topics.js b/src/topics.js index 8aa69d268b..24535805e3 100644 --- a/src/topics.js +++ b/src/topics.js @@ -176,7 +176,7 @@ var async = require('async'), return array.map(function(topic) { return topic && topic[field]; }).filter(function(value, index, array) { - return value && array.indexOf(value) === index; + return utils.isNumber(value) && array.indexOf(value) === index; }); } diff --git a/src/user.js b/src/user.js index ad2d5852f9..6cd8a125ea 100644 --- a/src/user.js +++ b/src/user.js @@ -109,6 +109,7 @@ var async = require('async'), } if (!parseInt(user.uid, 10)) { + user.uid = 0; user.username = '[[global:guest]]'; user.userslug = ''; }