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 421 421 class << self 422 422 def parse_query_parameters(query_string) 423 423 return {} if query_string.blank? 424 424 # & is not supported in Firefox 2.0.0.12 Windows 425 query_string = query_string.gsub("amp;", "") 425 426 pairs = query_string.split('&').collect do |chunk| 426 427 next if chunk.empty? 427 428 key, value = chunk.split('=', 2) -
a/actionpack/test/controller/request_test.rb
old new 447 447 @query_string_with_many_ampersands = 448 448 "&action=create_customer&&&full_name=David%20Heinemeier%20Hansson" 449 449 @query_string_with_empty_key = "action=create_customer&full_name=David%20Heinemeier%20Hansson&=Save" 450 @query_string_with_amp_chars = "action=create_customer&full_name=David" 450 451 end 451 452 452 453 def test_query_string … … 456 457 ) 457 458 end 458 459 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 459 467 def test_deep_query_string 460 468 expected = {'x' => {'y' => {'z' => '10'}}} 461 469 assert_equal(expected, ActionController::AbstractRequest.parse_query_parameters('x[y][z]=10'))