added some failsafe checks for filter:user.isModerator

v1.18.x
psychobunny 10 years ago
parent 6a47aacdfd
commit c0bce71984

@ -342,7 +342,12 @@ var async = require('async'),
if (err) { if (err) {
return callback(err); return callback(err);
} }
plugins.fireHook('filter:user.isModerator', {uid: uid, cid:cid, isModerator: isModerator}, function(err, data) { 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); callback(err, data.isModerator);
}); });
} }

Loading…
Cancel
Save