Skip to content

Commit

Permalink
[BUGFIX] Cast simulated timestamp to int
Browse files Browse the repository at this point in the history
`DateTimeImmutable::setTimestamp()` requires the timestamp to be an
integer.

Resolves: #103588
Related: #99627
Related: #98045
Releases: main, 12.4, 11.5
Change-Id: I2dba1b3836063872fa04ea38d58b5bd499a8f7d1
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83742
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Rafał Jania <rr.jania@gmail.com>
Tested-by: Rafał Jania <rr.jania@gmail.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
  • Loading branch information
georgringer committed Apr 12, 2024
1 parent b1293b6 commit 7196525
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions typo3/sysext/frontend/Classes/Middleware/PreviewSimulator.php
Expand Up @@ -159,8 +159,8 @@ protected function checkIfPageIsHidden(int $pageId, ServerRequestInterface $requ
*/
protected function simulateDate(ServerRequestInterface $request): bool
{
$queryTime = $request->getQueryParams()['ADMCMD_simTime'] ?? false;
if (!$queryTime) {
$queryTime = (int)($request->getQueryParams()['ADMCMD_simTime'] ?? 0);
if ($queryTime === 0) {
return false;
}

Expand Down

0 comments on commit 7196525

Please sign in to comment.