Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 4821

Show
Ignore:
Timestamp:
08/26/06 02:49:09 (2 years ago)
Author:
david
Message:

Changed the POST parameter processing to use the new QueryStringParser and make the result a indifferent hash [DHH]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/actionpack/CHANGELOG

    r4814 r4821  
    11*SVN* 
     2 
     3* Changed the POST parameter processing to use the new QueryStringParser and make the result a indifferent hash [DHH] 
    24 
    35* Add UrlWriter to allow writing urls from Mailers and scripts. [Nicholas Seckar] 
  • trunk/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb

    r4661 r4821  
    157157      end 
    158158       
    159       return result 
     159      return result.with_indifferent_access 
    160160    end 
    161161     
  • trunk/actionpack/lib/action_controller/cgi_process.rb

    r4595 r4821  
    6969          CGIMethods.parse_formatted_request_parameters(content_type, @env['RAW_POST_DATA']) 
    7070        else 
    71           CGIMethods.parse_request_parameters(@cgi.params
     71          CGIMethods.parse_query_parameters(@env['RAW_POST_DATA'] || ""
    7272        end 
    7373    end 
  • trunk/actionpack/test/controller/cgi_test.rb

    r4820 r4821  
    2828   
    2929  def test_deep_query_string 
    30     assert_equal({'x' => {'y' => {'z' => '10'}}}, CGIMethods.parse_query_parameters('x[y][z]=10')) 
     30    expected = {'x' => {'y' => {'z' => '10'}}} 
     31    assert_equal(expected, CGIMethods.parse_query_parameters('x[y][z]=10')) 
     32    assert_equal("10", CGIMethods.parse_query_parameters('x[y][z]=10')[:x][:y][:z]) 
    3133  end 
    3234   
     
    3941    assert_equal({'x' => {'y' => [{'z' => '10'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10')) 
    4042    assert_equal({'x' => {'y' => [{'z' => '10', 'w' => '10'}]}}, CGIMethods.parse_query_parameters('x[y][][z]=10&x[y][][w]=10')) 
    41     assert_equal({'x' => [{'y' => {'z' => '10', 'w' => '10'}}]}, CGIMethods.parse_query_parameters('x[][y][z]=10&x[][y][w]=10')) 
    4243  end 
    4344