From dd8b11c9a65996d62cf6ec15963e99ad6b65b0cc Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Mon, 3 Dec 2007 23:46:26 +0000 Subject: [PATCH] New Auth Framework: sanitize botusername ''before'' checking for existence --- lib/rbot/botuser.rb | 5 +++-- 1 file 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 -- 2.39.5