diff options
author | Nicholas Seckar <nseckar@gmail.com> | 2005-07-07 19:43:03 +0000 |
---|---|---|
committer | Nicholas Seckar <nseckar@gmail.com> | 2005-07-07 19:43:03 +0000 |
commit | 5727dc2f42874e32f8cac3c176a085de07b24dd9 (patch) | |
tree | c4a887960cde45a13e0b3b912a6925b2dc92766c /actionpack/lib | |
parent | e3af27c51b3a7bb9dcbb45bce07c029ba019eba3 (diff) | |
download | rails-5727dc2f42874e32f8cac3c176a085de07b24dd9.tar.gz rails-5727dc2f42874e32f8cac3c176a085de07b24dd9.tar.bz2 rails-5727dc2f42874e32f8cac3c176a085de07b24dd9.zip |
Properly unescape recognized path components. Fixes #1651.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1764 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index d69c862989..8673412401 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -245,12 +245,15 @@ module ActionController start = "(#{start})" unless /^\w+$/ =~ start value_expr = "#{g.path_name}[#{start}..-1] || []" - g.result key, "ActionController::Routing::PathComponent::Result.new(#{value_expr})" + g.result key, "ActionController::Routing::PathComponent::Result.new_escaped(#{value_expr})" g.finish(false) end class Result < ::Array def to_s() join '/' end + def self.new_escaped(strings) + new strings.collect {|str| CGI.unescape str} + end end end |