Skip to content

Commit dcc3c4c

Browse files
juliusknorrgrnd-alt
authored andcommitted
fix: Apply proper default timezone for watermarks
Signed-off-by: Julius Knorr <[email protected]> Signed-off-by: grnd-alt <[email protected]>
1 parent 7b3b2f5 commit dcc3c4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/Controller/WopiController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,13 @@ public function checkFileInfo($fileId, $access_token) {
206206
$share = $this->getShareForWopiToken($wopi);
207207
if ($this->permissionManager->shouldWatermark($file, $wopi->getEditorUid(), $share)) {
208208
$email = $user !== null && !$isPublic ? $user->getEMailAddress() : "";
209+
$currentDateTime = new \DateTime(
210+
'now',
211+
new \DateTimeZone($this->config->getSystemValueString('default_timezone', 'UTC'))
212+
);
209213
$replacements = [
210214
'userId' => $wopi->getEditorUid(),
211-
'date' => (new \DateTime())->format('Y-m-d H:i:s'),
215+
'date' => $currentDateTime->format('Y-m-d H:i:s'),
212216
'themingName' => \OC::$server->getThemingDefaults()->getName(),
213217
'userDisplayName' => $userDisplayName,
214218
'email' => $email,

0 commit comments

Comments
 (0)