mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Fixes the undefined index error with the DAV property getlastmodified
Signed-off-by: Max Kunzelmann <maxdev@posteo.de>
This commit is contained in:
parent
a1c148a7e7
commit
ee888875bb
1 changed files with 5 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue