Skip to content

Commit

Permalink
Fix hasUpdated for webdav storage
Browse files Browse the repository at this point in the history
  • Loading branch information
VicDeo committed Apr 23, 2020
1 parent 540b0cc commit 0f86aa4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/private/Files/Storage/DAV.php
Original file line number Diff line number Diff line change
Expand Up @@ -807,16 +807,18 @@ public function hasUpdated($path, $time) {
return false;
}
if (isset($response['{DAV:}getetag'])) {
$cachedData = $this->getCache()->get($path);
$etag = \trim($response['{DAV:}getetag'], '"');
if (!empty($etag) && $cachedData['etag'] !== $etag) {
$cachedData = $this->getCache()->get($path);
$cachedEtag = $cachedData['etag'] ?? null;
if (!empty($etag) && $cachedEtag !== $etag) {
return true;
} elseif (isset($response['{http://open-collaboration-services.org/ns}share-permissions'])) {
$sharePermissions = (int)$response['{http://open-collaboration-services.org/ns}share-permissions'];
return $sharePermissions !== $cachedData['permissions'];
} elseif (isset($response['{http://owncloud.org/ns}permissions'])) {
$permissions = $this->parsePermissions($response['{http://owncloud.org/ns}permissions']);
return $permissions !== $cachedData['permissions'];
$cachedPermissions = $cachedData['permissions'] ?? null;
return $permissions !== $cachedPermissions;
} else {
return false;
}
Expand Down

0 comments on commit 0f86aa4

Please sign in to comment.