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

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kunzelmann <maxdev@posteo.de>2022-03-20 02:38:07 +0300
committerMax Kunzelmann <maxdev@posteo.de>2022-03-20 02:38:07 +0300
commitee888875bb01031c6f21e48832313641ee6d726e (patch)
tree1f5127c34475aa238d333c3bf8205773cee816b5 /lib/private/Files/Storage
parenta1c148a7e7810e104834dea89e8f61bad76424f1 (diff)
Fixes the undefined index error with the DAV property getlastmodified
Signed-off-by: Max Kunzelmann <maxdev@posteo.de>
Diffstat (limited to 'lib/private/Files/Storage')
-rw-r--r--lib/private/Files/Storage/DAV.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php
index b4a85755b20..e4cea9dd60b 100644
--- a/lib/private/Files/Storage/DAV.php
+++ b/lib/private/Files/Storage/DAV.php
@@ -587,7 +587,7 @@ class DAV extends Common {
return false;
}
return [
- 'mtime' => strtotime($response['{DAV:}getlastmodified']),
+ 'mtime' => isset($response['{DAV:getlastmodified']) ? strtotime($response['{DAV:}getlastmodified']) : false,
'size' => (int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0,
];
} catch (\Exception $e) {
@@ -804,9 +804,12 @@ class DAV extends Common {
} else {
return false;
}
- } else {
+ } elseif (isset($response['{DAV:}getlastmodified'])) {
$remoteMtime = strtotime($response['{DAV:}getlastmodified']);
return $remoteMtime > $time;
+ } else {
+ // neither `getetag` nor `getlastmodified` is set
+ return false;
}
} catch (ClientHttpException $e) {
if ($e->getHttpStatus() === 405) {