mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
Changed the POST parameter processing to use the new QueryStringParser and make the result a indifferent hash [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4821 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Changed the POST parameter processing to use the new QueryStringParser and make the result a indifferent hash [DHH]
|
||||
|
||||
* Add UrlWriter to allow writing urls from Mailers and scripts. [Nicholas Seckar]
|
||||
|
||||
* Clean up and run the Active Record integration tests by default. #5854 [kevin.clark@gmail.com, Jeremy Kemper]
|
||||
|
||||
@@ -156,7 +156,7 @@ class CGIMethods #:nodoc:
|
||||
|
||||
end
|
||||
|
||||
return result
|
||||
return result.with_indifferent_access
|
||||
end
|
||||
|
||||
# Skip over the current term by scanning past the next &, or to
|
||||
|
||||
@@ -68,7 +68,7 @@ module ActionController #:nodoc:
|
||||
if ActionController::Base.param_parsers.has_key?(content_type)
|
||||
CGIMethods.parse_formatted_request_parameters(content_type, @env['RAW_POST_DATA'])
|
||||
else
|
||||
CGIMethods.parse_request_parameters(@cgi.params)
|
||||
CGIMethods.parse_query_parameters(@env['RAW_POST_DATA'] || "")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -27,7 +27,9 @@ class CGITest < Test::Unit::TestCase
|
||||
end
|
||||
|
||||
def test_deep_query_string
|
||||
assert_equal({'x' => {'y' => {'z' => '10'}}}, CGIMethods.parse_query_parameters('x[y][z]=10'))
|
||||
expected = {'x' => {'y' => {'z' => '10'}}}
|
||||
assert_equal(expected, CGIMethods.parse_query_parameters('x[y][z]=10'))
|
||||
assert_equal("10", CGIMethods.parse_query_parameters('x[y][z]=10')[:x][:y][:z])
|
||||
end
|
||||
|
||||
def test_deep_query_string_with_array
|
||||
@@ -38,7 +40,6 @@ class CGITest < Test::Unit::TestCase
|
||||
def test_deep_query_string_with_array_of_hash
|
||||
assert_equal({'x' => {'y' => [{'z' => '10'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10'))
|
||||
assert_equal({'x' => {'y' => [{'z' => '10', 'w' => '10'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][w]=10'))
|
||||
assert_equal({'x' => [{'y' => {'z' => '10', 'w' => '10'}}]}, CGIMethods.parse_query_parameters('x[][y][z]=10&x[][y][w]=10'))
|
||||
end
|
||||
|
||||
def test_deep_query_string_with_array_of_hashes_with_one_pair
|
||||
|
||||
Reference in New Issue
Block a user