From f2840f508da1e69450551d3e3404cd72a77427e3 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 21 Mar 2008 22:44:04 +0000 Subject: Fix an edge case with extra periods in Routing.normalize_paths. Closes #11337 [cavalle, veejar] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9069 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/lib/action_controller/routing.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/lib/action_controller') diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 70745f9d27..4cc5647cd9 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -272,8 +272,8 @@ module ActionController gsub(%r{(.)[\\/]$}, '\1') # drop final / or \ if path ends with it # eliminate .. paths where possible - re = %r{\w+[/\\]\.\.[/\\]} - path.gsub!(%r{\w+[/\\]\.\.[/\\]}, "") while path.match(re) + re = %r{[^/\\]+[/\\]\.\.[/\\]} + path.gsub!(re, "") while path.match(re) path end -- cgit v1.2.3