From c0bce71984796612a2838e2e57000016617196bb Mon Sep 17 00:00:00 2001 From: psychobunny Date: Tue, 2 Dec 2014 16:13:29 -0500 Subject: [PATCH] added some failsafe checks for filter:user.isModerator --- src/user.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/user.js b/src/user.js index f9f08328ea..21ddaa25c6 100644 --- a/src/user.js +++ b/src/user.js @@ -342,7 +342,12 @@ var async = require('async'), if (err) { return callback(err); } + plugins.fireHook('filter:user.isModerator', {uid: uid, cid:cid, isModerator: isModerator}, function(err, data) { + if (Array.isArray(uid) && !Array.isArray(data.isModerator) || Array.isArray(cid) && !Array.isArray(data.isModerator)) { + return callback(new Error('filter:user.isModerator - i/o mismatch')); + } + callback(err, data.isModerator); }); }