Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] ActionController::Integration::Session no longer mangles multiparameter attribute params when processing multipart requests

#2439

Fixed what I thought was a bug in Webrat, but turned out to be a bug in Rails.

Turns out, if you try:


post :update, :"foo(1i)" => 1980, :"foo(2i)" => 2, :"foo(3i)" => 27

…everything works as you would expect. The moment you make that post multipart, though, by adding a file to the mix:


post :update, :"foo(1i)" => 1980, :"foo(2i)" => 2, :"foo(3i)" => 27, :file => fixture_file_upload("birthday_suit.jpg", "image/jpg")

…params[:"foo(1i)"] unexpectedly becomes params[:"foo%281i%29"] as the curved brackets get escaped.

Patch attached!

Reported by Steven Luscher · April 7th, 2009 @ 04:46 AM

State: new
Milestone: 3.0.6
Assigned to: Michael Koziarski Michael Koziarski
Importance: Low

Activity

  1. Steven Luscher
    Steven Luscher
    • Tag changed from action_controller, integration_test to action_controller, integration_test, patch

    April 7th, 2009 @ 04:54 AM

  2. Mike Enriquez
    Mike Enriquez
    • Assigned user cleared.

    I think there's something funky with the patch. You probably meant this

    
    k = first ? key.to_s : "[#{key.to_s}]"
    

    instead of

    
    k = first ? key.to_s : "[key.to_s}]"
    

    May 10th, 2009 @ 01:56 AM

  3. Steven Luscher
    Steven Luscher
    • Assigned user set to Michael Koziarski

    Beautiful typo. Patched patch attached!

    May 10th, 2009 @ 03:59 AM

  4. Michael Koziarski
    Michael Koziarski
    • Milestone cleared.

    Applied to 2-3-stable, moving to 3.0.

    This patch doesn't apply cleanly to master, is it no longer needed or?

    June 9th, 2009 @ 09:15 AM

  5. Dan Pickett
    Dan Pickett

    We've added the test cases to Rails 3 to verify that this errant behavior does not exist on master

    Patch attached

    April 21st, 2010 @ 02:31 AM

  6. Dan Pickett
    Dan Pickett

    FYI I worked with the Boston.rb team on this!

    April 21st, 2010 @ 02:31 AM

  7. Dan Pickett
    Dan Pickett
    • Tag changed from action_controller, integration_test, patch to action_controller, bugmash, integration_test, patch

    May 9th, 2010 @ 06:17 PM

  8. Jeremy Kemper
    Jeremy Kemper
    • Milestone cleared.
    • Importance changed from to Low

    August 30th, 2010 @ 04:10 AM

  9. Jeremy Kemper
  10. Santiago Pastorino
  11. Santiago Pastorino
  12. Santiago Pastorino
    Santiago Pastorino
    • Milestone changed from 3.0.5 to 3.0.6

    February 27th, 2011 @ 03:15 AM

  13. belstaff bag
    belstaff bag

    Chickens slaughtered in the United States

    March 25th, 2011 @ 11:50 AM