Fix isIPBanned

This commit is contained in:
calzoneman 2014-03-25 17:22:48 -05:00
parent 095da3040b
commit b82b5289f1
1 changed files with 3 additions and 1 deletions

View File

@ -529,7 +529,9 @@ module.exports = {
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) {
callback(err, err ? false : rows.length > 0);
});