Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix nested parameter hash parsing bug. #10797 [thomas.lee]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9010 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 3a17ea9031c32bf3b5817c74bba777ec06c5eb41 1 parent 5483de0
risk danger olson technoweenie authored
2  actionpack/CHANGELOG
View
@@ -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]
1  actionpack/lib/action_controller/request.rb
View
@@ -674,6 +674,7 @@ def bind(key, value)
else
top << {key => value}.with_indifferent_access
push top.last
+ value = top[key]
end
else
top << value
6 actionpack/test/controller/request_test.rb
View
@@ -705,6 +705,12 @@ def test_parse_params_with_nil_key
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
Please sign in to comment.
Something went wrong with that request. Please try again.