summaryrefslogtreecommitdiff
path: root/lib/rbot
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-12-03 23:46:26 +0000
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2007-12-03 23:46:26 +0000
commitdd8b11c9a65996d62cf6ec15963e99ad6b65b0cc (patch)
treec33e569b7d25526ee7f4a35fe5d7e7a74f631529 /lib/rbot
parent9187a3a8e7260125acc72e9fd8b36cd96daf7c83 (diff)
New Auth Framework: sanitize botusername ''before'' checking for existence
Diffstat (limited to 'lib/rbot')
-rw-r--r--lib/rbot/botuser.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rbot/botuser.rb b/lib/rbot/botuser.rb
index de77093a..defb3a47 100644
--- a/lib/rbot/botuser.rb
+++ b/lib/rbot/botuser.rb
@@ -810,8 +810,9 @@ class Bot
# BotUser (if any) it's logged in as
#
def make_permanent(user, name)
+ buname = BotUser.sanitize_username(name)
# TODO merge BotUser instead?
- raise "there's already a BotUser called #{name}" if include?(name)
+ raise "there's already a BotUser called #{name}" if include?(buname)
tuser = nil
case user
@@ -825,7 +826,7 @@ class Bot
return nil unless tuser
raise TypeError, "#{tuser} is not transient" unless tuser.transient?
- tuser.make_permanent(name)
+ tuser.make_permanent(buname)
@allbotusers[tuser.username.to_sym] = tuser
return tuser