From 0a0b5bd7220883b0517972c2c2b0f808647d22fc Mon Sep 17 00:00:00 2001 From: Jamis Buck Date: Fri, 21 Apr 2006 17:21:26 +0000 Subject: fix to ';' interpretation in route recognition--only follow a route with ';' if the segment in question actually contains a ';' git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4244 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/routing.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'actionpack/lib/action_controller/routing.rb') diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 4fa1acf95e..d0726e8a8b 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -78,10 +78,11 @@ module ActionController def write_recognition(g) raise RoutingError, "Subpath components must occur last" unless g.after.empty? - g.next_segment - g.line "subindex, subpath = 0, #{g.next_segment}.split(/;/)" - tweak_recognizer(g).go - g.move_forward { |gg| gg.continue } + g.if("#{g.next_segment(true)} && #{g.next_segment}.include?(';')") do |gp| + gp.line "subindex, subpath = 0, #{gp.next_segment}.split(/;/)" + tweak_recognizer(gp).go + gp.move_forward { |gpp| gpp.continue } + end end def write_generation(g) -- cgit v1.2.3