From 137bc01ecbfb306feda7f6258bbdf32db008350f Mon Sep 17 00:00:00 2001 From: Julius Knorr Date: Mon, 30 Dec 2024 11:44:57 +0100 Subject: [PATCH] fix: Apply proper default timezone for watermarks Signed-off-by: Julius Knorr --- lib/Controller/WopiController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index 256057cace..1f40e1243a 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -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,