Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/richdocuments.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAshod Nakashian <Ashod@users.noreply.github.com>2022-01-27 16:40:45 +0300
committerJulius Härtl (Rebase PR Action) <github@juliushaertl.de>2022-02-08 23:32:56 +0300
commit86513226ea1df909a904e0459a020b74269e7031 (patch)
treef307bbb3023af9f155c3b42190252cff8c41c0a8 /lib
parent6d47572a40e0cf79ecd5500daf08c9b95134a055 (diff)
Blank timestamp is equivalent to null
The request->getHeader() function returns an empty string even when the header in question doesn't exist. Here we treat blank timestamps as if they weren't set, which translates to skipping the timestamp mismatch and forcing the PUT operation. Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/WopiController.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php
index 15805f3f..7cc57b7f 100644
--- a/lib/Controller/WopiController.php
+++ b/lib/Controller/WopiController.php
@@ -487,7 +487,7 @@ class WopiController extends Controller {
$file = $this->getFileForWopiToken($wopi);
$wopiHeaderTime = $this->request->getHeader('X-LOOL-WOPI-Timestamp');
- if ($wopiHeaderTime !== null && $wopiHeaderTime !== Helper::toISO8601($file->getMTime() ?? 0)) {
+ if (!empty($wopiHeaderTime) && $wopiHeaderTime !== Helper::toISO8601($file->getMTime() ?? 0)) {
$this->logger->debug('Document timestamp mismatch ! WOPI client says mtime {headerTime} but storage says {storageTime}', [
'headerTime' => $wopiHeaderTime,
'storageTime' => Helper::toISO8601($file->getMTime() ?? 0)