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:
authorLouis <6653109+artonge@users.noreply.github.com>2022-03-29 14:53:15 +0300
committerGitHub <noreply@github.com>2022-03-29 14:53:15 +0300
commit7d2cb35988cfff51fef31c3d319e12bea1386203 (patch)
tree5fa771503f3c2e85d424994aeb6b0745a8a6584f /lib/private/Files/Storage
parent262d22f1847f92de91eaeadc143e75e9b752a3ba (diff)
parent2952c7d01f9cbb7c22c532a895bb7b5ec3d528ea (diff)
Merge pull request #31632 from Maaxxs/fix-undefined-index-dav
Fixes the undefined index error with the DAV property getlastmodified
Diffstat (limited to 'lib/private/Files/Storage')
-rw-r--r--lib/private/Files/Storage/DAV.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/private/Files/Storage/DAV.php b/lib/private/Files/Storage/DAV.php
index b4a85755b20..ee874d97b55 100644
--- a/lib/private/Files/Storage/DAV.php
+++ b/lib/private/Files/Storage/DAV.php
@@ -587,8 +587,8 @@ class DAV extends Common {
return false;
}
return [
- 'mtime' => strtotime($response['{DAV:}getlastmodified']),
- 'size' => (int)isset($response['{DAV:}getcontentlength']) ? $response['{DAV:}getcontentlength'] : 0,
+ 'mtime' => isset($response['{DAV:}getlastmodified']) ? strtotime($response['{DAV:}getlastmodified']) : null,
+ 'size' => (int)($response['{DAV:}getcontentlength'] ?? 0),
];
} catch (\Exception $e) {
$this->convertException($e, $path);
@@ -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) {