Changeset 5094
- Timestamp:
- 09/12/06 20:57:09 (2 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb (modified) (2 diffs)
- trunk/actionpack/test/controller/cgi_test.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r5086 r5094 1 1 *SVN* 2 3 * Skip params with empty names, such as the &=Save query string from <input type="submit"/>. #2569 [manfred, raphinou@yahoo.com] 2 4 3 5 * Fix assert_tag so that :content => "foo" does not match substrings, but only exact strings. Use :content => /foo/ to match substrings. #2799 [Eric Hodel] trunk/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb
r5070 r5094 12 12 next if chunk.empty? 13 13 key, value = chunk.split('=', 2) 14 next if key.empty? 14 15 value = (value.nil? || value.empty?) ? nil : CGI.unescape(value) 15 16 [ key, value ] … … 27 28 finished = true 28 29 for key, value in params 29 next unless key30 next if key.blank? 30 31 if !key.include?('[') 31 32 # much faster to test for the most common case first (GET) trunk/actionpack/test/controller/cgi_test.rb
r4866 r5094 17 17 @query_string_without_equal = "action" 18 18 @query_string_with_many_ampersands = 19 "&action=create_customer&&&full_name=David%20Heinemeier%20Hansson" 19 "&action=create_customer&&&full_name=David%20Heinemeier%20Hansson" 20 @query_string_with_empty_key = "action=create_customer&full_name=David%20Heinemeier%20Hansson&=Save" 20 21 end 21 22 … … 99 100 CGIMethods.parse_query_parameters(@query_string_without_equal) 100 101 ) 102 end 103 104 def test_query_string_with_empty_key 105 assert_equal( 106 { "action" => "create_customer", "full_name" => "David Heinemeier Hansson" }, 107 CGIMethods.parse_query_parameters(@query_string_with_empty_key) 108 ) 101 109 end 102 110 … … 118 126 "something_empty" => [ "" ], 119 127 "products[first]" => [ "Apple Computer" ], 120 "products[second]" => [ "Pc" ] 128 "products[second]" => [ "Pc" ], 129 "" => [ 'Save' ] 121 130 } 122 131