Merge pull request #9968 from dmipeck/pulls/datetime-mock-defensive-copy

FIX Defensively copy mocked datetime
This commit is contained in:
Daniel Hensby 2021-06-07 22:58:00 +01:00 committed by GitHub
commit c79638be02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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());
}