From d751305992437967621bdb9121376ea5c1753bcf Mon Sep 17 00:00:00 2001 From: Raine Virta Date: Thu, 23 Sep 2010 16:04:15 +0300 Subject: translator: stricter url mapping --- data/rbot/plugins/translator.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'data/rbot') diff --git a/data/rbot/plugins/translator.rb b/data/rbot/plugins/translator.rb index c4eaac4f..8d8e5388 100644 --- a/data/rbot/plugins/translator.rb +++ b/data/rbot/plugins/translator.rb @@ -453,10 +453,10 @@ end plugin = TranslatorPlugin.new req = Hash[*%w(from to).map { |e| [e.to_sym, /#{plugin.languages.join("|")}/] }.flatten] -plugin.map 'translate [:from] [:to] *url', - :action => :cmd_translate_url, :requirements => req.merge(:url => %r{^https?://.*}) -plugin.map 'translator [:from] [:to] *url', - :action => :cmd_translate_url, :requirements => req.merge(:url => %r{^https?://.*}) +plugin.map 'translate [:from] [:to] :url', + :action => :cmd_translate_url, :requirements => req.merge(:url => %r{^https?://[^\s]*}) +plugin.map 'translator [:from] [:to] :url', + :action => :cmd_translate_url, :requirements => req.merge(:url => %r{^https?://[^\s]*}) plugin.map 'translate [:from] [:to] *phrase', :action => :cmd_translator, :thread => true, :requirements => req plugin.map 'translator [:from] [:to] *phrase', -- cgit v1.2.3