From 41198ad3ad1925b2b88df9b16638c36dee43500f Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Fri, 12 Jan 2007 09:10:58 +0000 Subject: Fix parsing of array[] CGI parameters so extra empty values aren't included. Closes #6252. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5904 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/cgi_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/test/controller/cgi_test.rb') diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index 1d2888ad89..e7d44802a5 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -425,4 +425,16 @@ class CGIRequestTest < Test::Unit::TestCase assert_equal ["c84ace84796670c052c6ceb2451fb0f2"], alt_cookies["_session_id"] assert_equal ["yes"], alt_cookies["is_admin"] end + + def test_unbalanced_query_string_with_array + assert_equal( + {'location' => ["1", "2"], 'age_group' => ["2"]}, + CGIMethods.parse_query_parameters("location[]=1&location[]=2&age_group[]=2") + ) + assert_equal( + {'location' => ["1", "2"], 'age_group' => ["2"]}, + CGIMethods.parse_request_parameters({'location[]' => ["1", "2"], + 'age_group[]' => ["2"]}) + ) + end end -- cgit v1.2.3