mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #31632 from Maaxxs/fix-undefined-index-dav
Fixes the undefined index error with the DAV property getlastmodified
This commit is contained in:
commit
7d2cb35988
1 changed files with 6 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue