diff options
author | Louis <6653109+artonge@users.noreply.github.com> | 2022-03-29 13:53:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-29 13:53:15 +0200 |
commit | 7d2cb35988cfff51fef31c3d319e12bea1386203 (patch) | |
tree | 5fa771503f3c2e85d424994aeb6b0745a8a6584f /lib/private | |
parent | 262d22f1847f92de91eaeadc143e75e9b752a3ba (diff) | |
parent | 2952c7d01f9cbb7c22c532a895bb7b5ec3d528ea (diff) | |
download | nextcloud-server-7d2cb35988cfff51fef31c3d319e12bea1386203.tar.gz nextcloud-server-7d2cb35988cfff51fef31c3d319e12bea1386203.zip |
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')
-rw-r--r-- | lib/private/Files/Storage/DAV.php | 9 |
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) { |