diff options
-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) { |