diff options
author | Raine Virta <rane@kapsi.fi> | 2010-09-23 16:04:15 +0300 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-09-23 15:05:32 +0200 |
commit | d751305992437967621bdb9121376ea5c1753bcf (patch) | |
tree | 11a41cb724e6efb5a0ce591fc61003530b2b0114 /data/rbot | |
parent | 027176314c99e295b20026efa931bded5735dcd4 (diff) |
translator: stricter url mapping
Diffstat (limited to 'data/rbot')
-rw-r--r-- | data/rbot/plugins/translator.rb | 8 |
1 files changed, 4 insertions, 4 deletions
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', |