Skip to content

Commit

Permalink
[BUGFIX] Enforce int for timestamp on DateTime mapping
Browse files Browse the repository at this point in the history
This patch ensures using an integer value for turning a timestamp
to a DateTime object as otherwise a PHP error is thrown.

Resolves: #84962
Releases: master, 8.7, 7.6
Change-Id: I18e82c8f91f42c29c4014985a1ad11671b5a31f4
Reviewed-on: https://review.typo3.org/56914
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
  • Loading branch information
IchHabRecht authored and liayn committed May 10, 2018
1 parent 1c1677b commit 28a3f53
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -334,7 +334,7 @@ protected function mapDateTime($value, $storageFormat = null, $targetType = 'Dat
return $utcDateTime->setTimezone($currentTimeZone);
}
// integer timestamps are local server time
return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($targetType, date('c', $value));
return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($targetType, date('c', (int)$value));
}

/**
Expand Down

0 comments on commit 28a3f53

Please sign in to comment.