mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-13 09:25:45 +01:00
blacklist should not use data.result anymore, just err is fine
This commit is contained in:
@@ -67,14 +67,13 @@ Blacklist.test = function (clientIp, callback) {
|
|||||||
// return ip.cidrSubnet(subnet).contains(clientIp);
|
// return ip.cidrSubnet(subnet).contains(clientIp);
|
||||||
}) // not in a blacklisted IPv4 or IPv6 cidr range
|
}) // not in a blacklisted IPv4 or IPv6 cidr range
|
||||||
) {
|
) {
|
||||||
plugins.fireHook('filter:blacklist.test', {
|
plugins.fireHook('filter:blacklist.test', { // To return test failure, pass back an error in callback
|
||||||
ip: clientIp,
|
ip: clientIp,
|
||||||
result: false,
|
}, function (err) {
|
||||||
}, function (err, data) {
|
|
||||||
if (typeof callback === 'function') {
|
if (typeof callback === 'function') {
|
||||||
callback(err);
|
callback(err);
|
||||||
} else {
|
} else {
|
||||||
return data.result;
|
return !!err;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user