[BUGFIX] Ignore timezone for admin panel simulated time 80/57080/4
authorTizian Schmidlin <st@cabag.ch>
Tue, 29 May 2018 09:35:52 +0000 (11:35 +0200)
committerMathias Brodala <mbrodala@pagemachine.de>
Wed, 30 May 2018 08:39:17 +0000 (10:39 +0200)
By default, the simulated time of the admin panel does not take the server
timezone into account. This leads to several issues described in the
Forge ticket.

This fix makes sure that the timezone is removed from the users passed
value from the admin panel.

Since the admin panel was reworked in TYPO3 9, this patch does not apply
to master.

Resolves: #66793
Releases: 8.7, 7.6
Change-Id: Ifd86a5f78c10cec54a9fbc4210fd8a68c2be7d6f
Reviewed-on: https://review.typo3.org/57080
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Sybille Peters <sypets@gmx.de>
Tested-by: Sybille Peters <sypets@gmx.de>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php

index 266adc7..645762f 100644 (file)
@@ -1225,6 +1225,7 @@ class TypoScriptFrontendController
                     // Simulate date
                     $simTime = $backendUser->adminPanel->extGetFeAdminValue('preview', 'simulateDate');
                     if ($simTime) {
+                        $simTime -= date('Z', $simTime);
                         $GLOBALS['SIM_EXEC_TIME'] = $simTime;
                         $GLOBALS['SIM_ACCESS_TIME'] = $simTime - $simTime % 60;
                     }