Skip to content

Commit

Permalink
Merge pull request #4366 from nextcloud/fix/4364
Browse files Browse the repository at this point in the history
fix: Apply proper default timezone for watermarks
  • Loading branch information
elzody authored Jan 9, 2025
2 parents e27501d + 137bc01 commit c298faa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/Controller/WopiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,13 @@ public function checkFileInfo(string $fileId, string $access_token): JSONRespons
$share = $this->getShareForWopiToken($wopi);
if ($this->permissionManager->shouldWatermark($file, $wopi->getEditorUid(), $share)) {
$email = $user !== null && !$isPublic ? $user->getEMailAddress() : '';
$currentDateTime = new \DateTime(
'now',
new \DateTimeZone($this->config->getSystemValueString('default_timezone', 'UTC'))
);
$replacements = [
'userId' => $wopi->getEditorUid(),
'date' => (new \DateTime())->format('Y-m-d H:i:s'),
'date' => $currentDateTime->format('Y-m-d H:i:s'),
'themingName' => \OC::$server->getThemingDefaults()->getName(),
'userDisplayName' => $userDisplayName,
'email' => $email,
Expand Down

0 comments on commit c298faa

Please sign in to comment.