Changeset 6081
- Timestamp:
- 01/28/07 17:00:17 (2 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb (modified) (1 diff)
- trunk/actionpack/test/controller/cgi_test.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r6080 r6081 1 1 *SVN* 2 3 * Change the query parser to map empty GET params to "" rather than nil. Closes #5694. [Nicholas Seckar] 2 4 3 5 * date_select and datetime_select take a :default option. #7052 [nik.wakelin] trunk/actionpack/lib/action_controller/cgi_ext/cgi_methods.rb
r6044 r6081 13 13 key, value = chunk.split('=', 2) 14 14 next if key.empty? 15 value = (value.nil? || value.empty?)? nil : CGI.unescape(value)15 value = value.nil? ? nil : CGI.unescape(value) 16 16 [ CGI.unescape(key), value ] 17 17 end.compact trunk/actionpack/test/controller/cgi_test.rb
r5904 r6081 9 9 def setup 10 10 @query_string = "action=create_customer&full_name=David%20Heinemeier%20Hansson&customerId=1" 11 @query_string_with_ nil= "action=create_customer&full_name="11 @query_string_with_empty = "action=create_customer&full_name=" 12 12 @query_string_with_array = "action=create_customer&selected[]=1&selected[]=2&selected[]=3" 13 13 @query_string_with_amps = "action=create_customer&name=Don%27t+%26+Does" … … 69 69 def test_query_string_with_nil 70 70 assert_equal( 71 { "action" => "create_customer", "full_name" => nil},72 CGIMethods.parse_query_parameters(@query_string_with_ nil)71 { "action" => "create_customer", "full_name" => ''}, 72 CGIMethods.parse_query_parameters(@query_string_with_empty) 73 73 ) 74 74 end