mirror of
https://github.com/github/rails.git
synced 2026-04-04 03:00:58 -04:00
InstanceTag#default_time_from_options overflows to DateTime
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
* InstanceTag#default_time_from_options overflows to DateTime [Geoff Buesing]
|
||||
|
||||
*2.1.0 RC1 (May 11th, 2008)*
|
||||
|
||||
* Fixed that forgery protection can be used without session tracking (Peter Jones) [#139]
|
||||
|
||||
@@ -689,7 +689,7 @@ module ActionView
|
||||
default[key] ||= time.send(key)
|
||||
end
|
||||
|
||||
Time.utc(default[:year], default[:month], default[:day], default[:hour], default[:min], default[:sec])
|
||||
Time.utc_time(default[:year], default[:month], default[:day], default[:hour], default[:min], default[:sec])
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1722,6 +1722,12 @@ class DateHelperTest < ActionView::TestCase
|
||||
assert_equal 2, dummy_instance_tag.send!(:default_time_from_options, :hour => 2).hour
|
||||
end
|
||||
end
|
||||
|
||||
def test_instance_tag_default_time_from_options_handles_far_future_date
|
||||
dummy_instance_tag = ActionView::Helpers::InstanceTag.new(1,2,3)
|
||||
time = dummy_instance_tag.send!(:default_time_from_options, :year => 2050, :month => 2, :day => 10, :hour => 15, :min => 30, :sec => 45)
|
||||
assert_equal 2050, time.year
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
Reference in New Issue
Block a user