diff options
author | Yaohan Chen <hagabaka@nanomachine.STUDENT.cwru.edu> | 2008-03-21 10:41:49 -0400 |
---|---|---|
committer | Yaohan Chen <hagabaka@nanomachine.STUDENT.cwru.edu> | 2008-03-21 10:41:49 -0400 |
commit | 2181f8f40f6dfc1ca7e48d82c0dfdcde6436ce72 (patch) | |
tree | d716333ba74602cb35e6859445d72f282a6209c1 /lib | |
parent | 19773ee72b72a74f6fe911750ae7a2337a81893d (diff) |
message.rb: Regexp.escape nickname when embedding it in regexp, as nicknames can contain [ ] | etc
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rbot/message.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rbot/message.rb b/lib/rbot/message.rb index df3812e0..35100802 100644 --- a/lib/rbot/message.rb +++ b/lib/rbot/message.rb @@ -334,7 +334,7 @@ module Irc # the nick or core.reply_with_nick is set to false # def reply(string, options={}) - if @bot.config['core.reply_with_nick'] and not string =~ /\b#{@source}\b/ + if @bot.config['core.reply_with_nick'] and not string =~ /\b#{Regexp.escape(@source.to_s)}\b/ return nickreply(string, options) end plainreply(string, options) |