Ticket #10797: 10797-005.patch
| File 10797-005.patch, 1.3 kB (added by thomas.lee, 6 months ago) |
|---|
-
a/actionpack/lib/action_controller/request.rb
old new 682 682 elsif top.is_a? Hash 683 683 key = CGI.unescape(key) 684 684 parent << (@top = {}) if top.key?(key) && parent.is_a?(Array) 685 return top[key] ||= value 685 top[key] ||= value 686 return top[key] 686 687 else 687 688 raise ArgumentError, "Don't know what to do: top is #{top.inspect}" 688 689 end -
a/actionpack/test/controller/request_test.rb
old new 711 711 expected = {"a" => [{"b" => {"c" => "d"}}]} 712 712 assert_equal expected, ActionController::AbstractRequest.parse_request_parameters(input) 713 713 end 714 715 def test_parse_params_with_complex_nesting 716 input = { "a[][b][c][][d][]" => %w(e) } 717 expected = {"a" => [{"b" => {"c" => [{"d" => ["e"]}]}}]} 718 assert_equal expected, ActionController::AbstractRequest.parse_request_parameters(input) 719 end 714 720 end 715 721 716 722