mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 18:56:15 +01:00
check count before privileges
This commit is contained in:
@@ -12,8 +12,11 @@ var async = require('async'),
|
|||||||
|
|
||||||
module.exports = function(Categories) {
|
module.exports = function(Categories) {
|
||||||
Categories.getRecentReplies = function(cid, uid, count, callback) {
|
Categories.getRecentReplies = function(cid, uid, count, callback) {
|
||||||
|
if(!parseInt(count, 10)) {
|
||||||
|
return callback(null, []);
|
||||||
|
}
|
||||||
privileges.categories.can('read', cid, uid, function(err, canRead) {
|
privileges.categories.can('read', cid, uid, function(err, canRead) {
|
||||||
if (err || !canRead || !parseInt(count, 10)) {
|
if (err || !canRead) {
|
||||||
return callback(err, []);
|
return callback(err, []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user