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

Ticket #11539: patch.diff

File patch.diff, 1.7 kB (added by anildigital, 3 months ago)
  • a/actionpack/lib/action_controller/request.rb

    old new  
    421421    class << self 
    422422      def parse_query_parameters(query_string) 
    423423        return {} if query_string.blank? 
    424  
     424        # &amp; is not supported in Firefox 2.0.0.12 Windows 
     425        query_string = query_string.gsub("amp;", "") 
    425426        pairs = query_string.split('&').collect do |chunk| 
    426427          next if chunk.empty? 
    427428          key, value = chunk.split('=', 2) 
  • a/actionpack/test/controller/request_test.rb

    old new  
    447447    @query_string_with_many_ampersands = 
    448448      "&action=create_customer&&&full_name=David%20Heinemeier%20Hansson" 
    449449    @query_string_with_empty_key = "action=create_customer&full_name=David%20Heinemeier%20Hansson&=Save" 
     450    @query_string_with_amp_chars = "action=create_customer&amp;full_name=David" 
    450451  end 
    451452 
    452453  def test_query_string 
     
    456457    ) 
    457458  end 
    458459 
     460  def test_query_string_with_amp_chars 
     461    assert_equal( 
     462      { "action" => "create_customer", "full_name" => "David"}, 
     463      ActionController::AbstractRequest.parse_query_parameters(@query_string_with_amp_chars) 
     464    ) 
     465  end 
     466 
    459467  def test_deep_query_string 
    460468    expected = {'x' => {'y' => {'z' => '10'}}} 
    461469    assert_equal(expected, ActionController::AbstractRequest.parse_query_parameters('x[y][z]=10'))