diff options
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rwxr-xr-x | actionpack/lib/action_controller/request.rb | 1 | ||||
-rw-r--r-- | actionpack/test/controller/request_test.rb | 6 |
3 files changed, 9 insertions, 0 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 43fb5556f9..3063b26c7c 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fix nested parameter hash parsing bug. #10797 [thomas.lee] + * Allow using named routes in ActionController::TestCase before any request has been made. Closes #11273 [alloy] * Fixed that sweepers defined by cache_sweeper will be added regardless of the perform_caching setting. Instead, control whether the sweeper should be run with the perform_caching setting. This makes testing easier when you want to turn perform_caching on/off [DHH] diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index f626abf2b0..9aff733a5c 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -674,6 +674,7 @@ module ActionController else top << {key => value}.with_indifferent_access push top.last + value = top[key] end else top << value diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb index 68d6afb426..bae4d6ffe4 100644 --- a/actionpack/test/controller/request_test.rb +++ b/actionpack/test/controller/request_test.rb @@ -705,6 +705,12 @@ class UrlEncodedRequestParameterParsingTest < Test::Unit::TestCase expected = { "test2" => "value1" } assert_equal expected, ActionController::AbstractRequest.parse_request_parameters(input) end + + def test_parse_params_with_array_prefix_and_hashes + input = { "a[][b][c]" => %w(d) } + expected = {"a" => [{"b" => {"c" => "d"}}]} + assert_equal expected, ActionController::AbstractRequest.parse_request_parameters(input) + end end |