This project is archived and is in readonly mode.
Incorrect parsing of query parameters with mixed-depth nesting inside an array
Reported by Mark Reginald James | December 23rd, 2008 @ 06:08 PM | in 2.x
Query parameters
x[y][][z]=10&x[y][][v][w]=10
(parameter order is important!)
are assembled into the params hash as
{"x"=>{"y"=>[{"v"=>{}, "z"=>"10"}]}}
instead of the correct
{"x"=>{"y"=>[{"v"=>{"w"=>"10"}, "z"=>"10"}]}}
A patch to request.rb is attached, including a new unit test that fails without the code patch.
The main bug was that on one code branch an empty hash is added to a hash_with_indifferent_access, but the standard empty hash was returned rather than the indifferent_access version of this empty hash, meaning that any updates to this hash did not go into the result hash, but into a separate hash object.
A push of the nesting stack was also missing from this code branch.
Comments and changes to this ticket
-
Frederick Cheung December 27th, 2008 @ 03:05 PM
Could you rebase this against the latest master? patch no longer applies after the parameter parsing stuff was moved to request_parser.rb
-
Repository December 30th, 2008 @ 06:09 PM
- State changed from new to resolved
(from [5138f755ff31a8f317d649a6f256c74bc371db70]) Fixed incorrect parsing of query parameters with mixed-depth nesting inside an array [#1622 state:resolved]
Signed-off-by: Frederick Cheung frederick.cheung@gmail.com http://github.com/rails/rails/co...
-
Repository February 2nd, 2009 @ 07:57 PM
(from [ea2090176488246eb780ac654ce5c1063a791dfa]) Fixed incorrect parsing of query parameters with mixed-depth nesting inside an array [#1622 state:resolved]
Signed-off-by: Frederick Cheung frederick.cheung@gmail.com http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1615 Nested form params do not work reliably Looks the same as #1622 to me.
- 1622 Incorrect parsing of query parameters with mixed-depth nesting inside an array (from [5138f755ff31a8f317d649a6f256c74bc371db70]) Fixed i...
- 1622 Incorrect parsing of query parameters with mixed-depth nesting inside an array (from [ea2090176488246eb780ac654ce5c1063a791dfa]) Fixed i...