mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #9968 from dmipeck/pulls/datetime-mock-defensive-copy
FIX Defensively copy mocked datetime
This commit is contained in:
commit
c79638be02
@ -173,7 +173,7 @@ class DBDatetime extends DBDate implements TemplateGlobalProvider
|
||||
/** @var DBDatetime $now */
|
||||
$now = null;
|
||||
if (self::$mock_now) {
|
||||
$now = self::$mock_now;
|
||||
$now = DBField::create_field('Datetime', self::$mock_now->Value);
|
||||
} else {
|
||||
$now = DBField::create_field('Datetime', time());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user