Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-04-27 18:41:02 +0300
committerVincent Petry <pvince81@owncloud.com>2015-06-03 18:24:26 +0300
commit533bb85a858904b433403ecfd2396b13403274c0 (patch)
tree234f051d2a30c4fdb2e14dec11473895c1290cde /lib
parentd1f99f10036dd859a5fa36cddeb4663665a17c58 (diff)
Get etag from remote OC server
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/dav.php20
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/private/files/storage/dav.php b/lib/private/files/storage/dav.php
index 9734d36f37d..1385c08e906 100644
--- a/lib/private/files/storage/dav.php
+++ b/lib/private/files/storage/dav.php
@@ -468,7 +468,7 @@ class DAV extends \OC\Files\Storage\Common {
public function getPermissions($path) {
$this->init();
$path = $this->cleanPath($path);
- $response = $this->client->propfind($this->encodePath($path), array('{http://owncloud.org/ns}permissions'));
+ $response = $this->propfind($path);
if (isset($response['{http://owncloud.org/ns}permissions'])) {
return $this->parsePermissions($response['{http://owncloud.org/ns}permissions']);
} else if ($this->is_dir($path)) {
@@ -480,6 +480,17 @@ class DAV extends \OC\Files\Storage\Common {
}
}
+ /** {@inheritdoc} */
+ public function getETag($path) {
+ $this->init();
+ $path = $this->cleanPath($path);
+ $response = $this->propfind($path);
+ if (isset($response['{DAV:}getetag'])) {
+ return trim($response['{DAV:}getetag'], '"');
+ }
+ return parent::getEtag($path);
+ }
+
/**
* @param string $permissionsString
* @return int
@@ -521,8 +532,11 @@ class DAV extends \OC\Files\Storage\Common {
));
if (isset($response['{DAV:}getetag'])) {
$cachedData = $this->getCache()->get($path);
- $etag = trim($response['{DAV:}getetag'], '"');
- if ($cachedData['etag'] !== $etag) {
+ $etag = null;
+ if (isset($response['{DAV:}getetag'])) {
+ $etag = trim($response['{DAV:}getetag'], '"');
+ }
+ if (!empty($etag) && $cachedData['etag'] !== $etag) {
return true;
} else if (isset($response['{http://owncloud.org/ns}permissions'])) {
$permissions = $this->parsePermissions($response['{http://owncloud.org/ns}permissions']);