diff options
author | Jamis Buck <jamis@37signals.com> | 2005-06-10 12:21:25 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-06-10 12:21:25 +0000 |
commit | f6ec9e3d66a8f5acd5eb79e3d1f77a2d1e1b5d31 (patch) | |
tree | 0c4cfdc0107d2c07176310418ea3772ecce188c6 | |
parent | 6cff8487ed241e5e8b032664664021bc5dd52c5e (diff) | |
download | rails-f6ec9e3d66a8f5acd5eb79e3d1f77a2d1e1b5d31.tar.gz rails-f6ec9e3d66a8f5acd5eb79e3d1f77a2d1e1b5d31.tar.bz2 rails-f6ec9e3d66a8f5acd5eb79e3d1f77a2d1e1b5d31.zip |
Arrays sent via multipart posts are converted to strings #1032 [dj@omelia.org]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1397 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | actionpack/CHANGELOG | 2 | ||||
-rwxr-xr-x | actionpack/lib/action_controller/cgi_ext/cgi_methods.rb | 2 | ||||
-rwxr-xr-x | actionpack/test/controller/cgi_test.rb | 5 |
3 files changed, 8 insertions, 1 deletions
diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index 5923f0c6f8..081abbd11a 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Arrays sent via multipart posts are converted to strings #1032 [dj@omelia.org] + * render(:layout => true) is a synonym for render(:layout => nil) * Make sure the benchmarking render method always returns the output of the render. diff --git a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb index 0884d0ab89..59439cf8e5 100755 --- a/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb +++ b/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb @@ -69,7 +69,7 @@ class CGIMethods #:nodoc: # Value as part of a multipart request value.read elsif value.class == Array - value + value.collect { | e | e.respond_to?(:read) ? e.read : e } else # Standard value (not a multipart request) value.to_s diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb index dbdf6a5b96..f0058d2bf8 100755 --- a/actionpack/test/controller/cgi_test.rb +++ b/actionpack/test/controller/cgi_test.rb @@ -94,12 +94,16 @@ class CGITest < Test::Unit::TestCase input = { "something" => [ StringIO.new("") ], + "array_of_stringios" => [[ StringIO.new("One"), StringIO.new("Two") ]], + "mixed_types_array" => [[ StringIO.new("Three"), "NotStringIO" ]], "products[string]" => [ StringIO.new("Apple Computer") ], "products[file]" => [ mock_file ] } expected_output = { "something" => "", + "array_of_stringios" => ["One", "Two"], + "mixed_types_array" => [ "Three", "NotStringIO" ], "products" => { "string" => "Apple Computer", "file" => mock_file @@ -169,3 +173,4 @@ class CGITest < Test::Unit::TestCase assert_equal expected, CGIMethods.parse_request_parameters(input) end end + |