Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Commit

Permalink
Fix for command prefixes that are special regex characters
Browse files Browse the repository at this point in the history
  • Loading branch information
Tim Morgan committed Jun 28, 2008
1 parent 2f14448 commit 859127a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libs/leaf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ def startup_check
def parse_for_command(stem, sender, arguments)
if arguments[:channel] or options[:respond_to_private_messages] then
reply_to = arguments[:channel] ? arguments[:channel] : sender[:nick]
if arguments[:message] =~ /^#{options[:command_prefix]}(\w+)\s*(.*)$/ then
if arguments[:message] =~ /^#{Regexp.escape options[:command_prefix]}(\w+)\s*(.*)$/ then
name = $1.to_sym
meth = "#{name}_command".to_sym
msg = $2
Expand Down

0 comments on commit 859127a

Please sign in to comment.