diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2009-11-04 16:11:59 -0800 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2009-11-04 16:27:54 -0800 |
commit | a8ed10546d844fc15d87f5c8f168a18d0cdab5f0 (patch) | |
tree | 072d00e206d3dfc45c791cdf6d20692207db8bda /actionpack/lib | |
parent | dc1816da30eace9f292bfc57e21fe76a05ae8ea7 (diff) | |
download | rails-a8ed10546d844fc15d87f5c8f168a18d0cdab5f0.tar.gz rails-a8ed10546d844fc15d87f5c8f168a18d0cdab5f0.tar.bz2 rails-a8ed10546d844fc15d87f5c8f168a18d0cdab5f0.zip |
Ruby 1.9: don't assume params are US-ASCII. Hands off the encoding.
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 93617e826d..28e5b806da 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -20,7 +20,12 @@ module ActionDispatch params = env[PARAMETERS_KEY] merge_default_action!(params) split_glob_param!(params) if @glob_param - params.each { |key, value| params[key] = URI.unescape(value) if value.is_a?(String) } + params.each do |key, value| + if value.is_a?(String) + value = value.dup.force_encoding(Encoding::BINARY) if value.respond_to?(:force_encoding) + params[key] = URI.unescape(value) + end + end if env['action_controller.recognize'] [200, {}, params] |