]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - lib/rbot/botuser.rb
rss plugin: watching now relies on an ID built from title, link and description to...
[user/henk/code/ruby/rbot.git] / lib / rbot / botuser.rb
index c0041d7f916ac96a22428debb9e5cd031230a153..bed2b627cb59e9a36ea3a0ca1757f6771ecf88e8 100644 (file)
@@ -34,8 +34,8 @@ module Irc
     #\r
     def Auth.random_password(l=8)\r
       pwd = ""\r
-      8.times do\r
-        pwd += (rand(26) + (rand(2) == 0 ? 65 : 97) ).chr\r
+      l.times do\r
+        pwd << (rand(26) + (rand(2) == 0 ? 65 : 97) ).chr\r
       end\r
       return pwd\r
     end\r
@@ -268,7 +268,7 @@ module Irc
           reset_password\r
         else\r
           begin\r
-            raise InvalidPassword, "#{pass} contains invalid characters" if pass !~ /^[A-Za-z0-9]+$/\r
+            raise InvalidPassword, "#{pass} contains invalid characters" if pass !~ /^[\x21-\x7e]+$/\r
             raise InvalidPassword, "#{pass} too short" if pass.length < 4\r
             @password = pass\r
           rescue InvalidPassword => e\r