aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-02-20 19:28:05 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-02-20 19:28:05 -0200
commit08cec83233c007efd69ef7f9d3b48cd408acafb4 (patch)
treed9305c3e5fe0bc856dea1cb7cebbef0604486260 /actionpack/lib/action_dispatch
parent2b63a354a8f5960a8c5ed4563fdc0730fd9b6809 (diff)
parent572bbab2e63916b4bb5e835d403856767b7f4be5 (diff)
downloadrails-08cec83233c007efd69ef7f9d3b48cd408acafb4.tar.gz
rails-08cec83233c007efd69ef7f9d3b48cd408acafb4.tar.bz2
rails-08cec83233c007efd69ef7f9d3b48cd408acafb4.zip
Merge pull request #18218 from brainopia/fix_match_shorthand_in_routes
Don't use shorthand match on routes with inappropriate symbols
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index f2c9e7b1a0..34b5b48f3a 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -1504,7 +1504,7 @@ module ActionDispatch
end
def using_match_shorthand?(path, options)
- path && (options[:to] || options[:action]).nil? && path =~ %r{/[\w/]+$}
+ path && (options[:to] || options[:action]).nil? && path =~ %r{^/?[-\w]+/[-\w/]+$}
end
def decomposed_match(path, options) # :nodoc: