From 6ec2c48fa89db6f290dbbbdbd62bc7ceccf3bcbb Mon Sep 17 00:00:00 2001 From: cyan <> Date: Sat, 22 Jul 2006 23:35:26 +0000 Subject: [PATCH] Oops, correct problems caused by working on old, non-CVS current files. Also, the URL in the previous commit was supposed to be this: http://www.andrewdupont.net/2006/05/18/javascript-associative-arrays-considered-harmful/ --- exec/load/ircd_channel.js | 14 +++++--------- exec/load/ircd_user.js | 7 +++---- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/exec/load/ircd_channel.js b/exec/load/ircd_channel.js index f9c9e13e6d..5a66b26ff5 100644 --- a/exec/load/ircd_channel.js +++ b/exec/load/ircd_channel.js @@ -540,15 +540,11 @@ function IRCClient_do_join(chan_name,join_key) { this.numeric403(chan_name); return 0; } - for (theChar in chan_name) { - var theChar_code = chan_name[theChar].charCodeAt(0); - if ((theChar_code <= 32) || (theChar_code == 44) || - (chan_name[theChar].charCodeAt(0) == 160)) { - if (this.local) - this.numeric(479, chan_name - + " :Channel name contains illegal characters."); - return 0; - } + if(chan_name.search(/[\x00-\x20\x2c\xa0]/)!=-1) { + if (this.local) + this.numeric(479, chan_name + + " :Channel name contains illegal characters."); + return 0; } if (this.channels[uc_chan_name]) return 0; diff --git a/exec/load/ircd_user.js b/exec/load/ircd_user.js index 312bcca358..53e50f1073 100644 --- a/exec/load/ircd_user.js +++ b/exec/load/ircd_user.js @@ -1348,10 +1348,10 @@ function User_Work() { } var firstnick=""; var aWhoWas; + var ww_nick_uc = cmd[1].toUpperCase(); for (aWhoWas=whowas_pointer;aWhoWas>=0;aWhoWas--) { var wwh = WhoWasHistory[aWhoWas]; - if (wwh && (wwh.nick.toUpperCase() == - cmd[1].toUpperCase())) { + if (wwh && (wwh.nick.toUpperCase() == ww_nick_uc)) this.numeric(314,wwh.nick + " " + wwh.uprefix + " " + wwh.host + " * :" + wwh.realname); this.numeric(312,wwh.nick + " " + wwh.server + " :" @@ -1362,8 +1362,7 @@ function User_Work() { } for (aWhoWas=whowas_buffer;aWhoWas>=whowas_pointer;aWhoWas--) { var wwh = WhoWasHistory[aWhoWas]; - if (wwh && (wwh.nick.toUpperCase() == - cmd[1].toUpperCase())) { + if (wwh && (wwh.nick.toUpperCase() == ww_nick_uc)) this.numeric(314,wwh.nick + " " + wwh.uprefix + " " + wwh.host + " * :" + wwh.realname); this.numeric(312,wwh.nick + " " + wwh.server + " :" -- GitLab