mirror of https://github.com/calzoneman/sync.git
Fix isIPBanned
This commit is contained in:
parent
095da3040b
commit
b82b5289f1
|
@ -529,7 +529,9 @@ module.exports = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
db.query("SELECT * FROM `chan_" + chan + "_bans` WHERE ip LIKE ?", [ip+"%"],
|
var range = ip.replace(/^(\d+\.\d+\.\d+)\.\d+$/, "$1");
|
||||||
|
|
||||||
|
db.query("SELECT * FROM `chan_" + chan + "_bans` WHERE ip=? OR ip=?", [ip, range],
|
||||||
function (err, rows) {
|
function (err, rows) {
|
||||||
callback(err, err ? false : rows.length > 0);
|
callback(err, err ? false : rows.length > 0);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue