Skip to content

Commit c298faa

Browse files
authored
Merge pull request #4366 from nextcloud/fix/4364
fix: Apply proper default timezone for watermarks
2 parents e27501d + 137bc01 commit c298faa

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
@@ -205,9 +205,13 @@ public function checkFileInfo(string $fileId, string $access_token): JSONRespons
205205
$share = $this->getShareForWopiToken($wopi);
206206
if ($this->permissionManager->shouldWatermark($file, $wopi->getEditorUid(), $share)) {
207207
$email = $user !== null && !$isPublic ? $user->getEMailAddress() : '';
208+
$currentDateTime = new \DateTime(
209+
'now',
210+
new \DateTimeZone($this->config->getSystemValueString('default_timezone', 'UTC'))
211+
);
208212
$replacements = [
209213
'userId' => $wopi->getEditorUid(),
210-
'date' => (new \DateTime())->format('Y-m-d H:i:s'),
214+
'date' => $currentDateTime->format('Y-m-d H:i:s'),
211215
'themingName' => \OC::$server->getThemingDefaults()->getName(),
212216
'userDisplayName' => $userDisplayName,
213217
'email' => $email,

0 commit comments

Comments
 (0)