From d3ba03ceaec5a0ab543b946eea98f7e70ed451bc Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 21 Feb 2014 11:16:44 -0500 Subject: [PATCH 1/3] fixed #1089 --- src/user.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/user.js b/src/user.js index 1a048c9d73..39f0befef9 100644 --- a/src/user.js +++ b/src/user.js @@ -1136,8 +1136,9 @@ var bcrypt = require('bcryptjs'), async.filter(nids, function(nid, next) { notifications.get(nid, uid, function(notifObj) { if(!notifObj) { - next(false); + return next(false); } + if (notifObj.uniqueId === uniqueId) { next(true); } else { From f6ea278b09fb56e304779e895d2967ef06a90109 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 21 Feb 2014 13:27:40 -0500 Subject: [PATCH 2/3] closed #1095 --- src/meta.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/meta.js b/src/meta.js index d95614b082..fd344b460e 100644 --- a/src/meta.js +++ b/src/meta.js @@ -243,7 +243,7 @@ var fs = require('fs'), minFile: path.join(__dirname, '..', 'public/src/nodebb.min.js'), get: function (callback) { plugins.fireHook('filter:scripts.get', this.scripts, function(err, scripts) { - var mtime, + var ctime, jsPaths = scripts.map(function (jsPath) { jsPath = path.normalize(jsPath); @@ -267,12 +267,12 @@ var fs = require('fs'), if (process.env.NODE_ENV !== 'development') { async.parallel({ - mtime: function (next) { + ctime: function (next) { async.map(jsPaths, fs.stat, function (err, stats) { async.reduce(stats, 0, function (memo, item, next) { if(item) { - mtime = +new Date(item.mtime); - next(null, mtime > memo ? mtime : memo); + ctime = +new Date(item.ctime); + next(null, ctime > memo ? ctime : memo); } else { next(null, memo); } @@ -286,14 +286,15 @@ var fs = require('fs'), } fs.stat(Meta.js.minFile, function (err, stat) { - next(err, +new Date(stat.mtime)); + next(err, +new Date(stat.ctime)); }); } }, function (err, results) { - if (results.minFile > results.mtime) { + if (results.minFile > results.ctime) { winston.info('No changes to client-side libraries -- skipping minification'); callback(null, [path.relative(path.join(__dirname, '../public'), Meta.js.minFile)]); } else { + winston.info('Minifying client-side libraries -- please wait'); Meta.js.minify(function () { callback(null, [ path.relative(path.join(__dirname, '../public'), Meta.js.minFile) From ea826ce48796be5024f2c630823c3fec01f8e6a0 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 21 Feb 2014 13:55:04 -0500 Subject: [PATCH 3/3] type checking 'plugin' when loading --- src/plugins.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins.js b/src/plugins.js index 9614777524..91a51d65c4 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -71,7 +71,7 @@ var fs = require('fs'), plugins.push(meta.config['theme:id']); async.each(plugins, function(plugin, next) { - if (!plugin) { + if (!plugin || typeof plugin !== 'string') { return next(); }