From 9703086c7c824b00f74091cd8279dba422e9c081 Mon Sep 17 00:00:00 2001 From: Calvin Montgomery Date: Sun, 9 Jun 2013 23:57:48 +0400 Subject: [PATCH] Fix IP hiding causing ban issues --- channel.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/channel.js b/channel.js index 651b3e96..ba4a24c5 100644 --- a/channel.js +++ b/channel.js @@ -402,7 +402,7 @@ Channel.prototype.tryIPBan = function(actor, data) { if(!this.hasPermission(actor, "ban")) { return false; } - if(typeof data.id != "string" || data.id.length != 15) { + if(typeof data.id != "string") { return false; } if(typeof data.name != "string") { @@ -635,16 +635,9 @@ Channel.prototype.kick = function(user, reason) { } Channel.prototype.hideIP = function(ip) { - while(ip.length < 15) { - ip += "X"; - } var chars = new Array(15); for(var i = 0; i < ip.length; i++) { chars[i] = String.fromCharCode(ip.charCodeAt(i) ^ this.ipkey.charCodeAt(i)); - if(chars[i] == "X") { - chars[i] = ""; - break; - } } return chars.join(""); }