summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2012-09-28 18:47:54 +0200
committerBjörn Schießle <schiessle@owncloud.com>2012-09-28 18:50:36 +0200
commit35357f3afb90dec1d0a9755ab0e0504a916c5e5a (patch)
treec1b2244ce17418ef018a165b508506d17c9ad9fd /lib
parentf8f73e267550a46dc4cee5b025e83d786cddb1bb (diff)
downloadnextcloud-server-35357f3afb90dec1d0a9755ab0e0504a916c5e5a.tar.gz
nextcloud-server-35357f3afb90dec1d0a9755ab0e0504a916c5e5a.zip
etag has to be removed after version rollback to enable the sync client to detect the changes (bug #1829)
Diffstat (limited to 'lib')
-rw-r--r--lib/filesystem.php9
-rw-r--r--lib/filesystemview.php3
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/filesystem.php b/lib/filesystem.php
index f5c10923b32..5516aae3976 100644
--- a/lib/filesystem.php
+++ b/lib/filesystem.php
@@ -521,12 +521,19 @@ class OC_Filesystem{
return self::$defaultInstance->hasUpdated($path,$time);
}
- static public function removeETagHook($params) {
+ static public function removeETagHook($params, $root = false) {
if (isset($params['path'])) {
$path=$params['path'];
} else {
$path=$params['oldpath'];
}
+
+ if (root) { // reduce path to the required part of it (no 'username/files')
+ $fakeRootView = new OC_FilesystemView($root);
+ $count = 1;
+ $path=str_replace(OC_App::getStorage("files")->getAbsolutePath(), "", $fakeRootView->getAbsolutePath($path), $count);
+ }
+
$path = self::normalizePath($path);
OC_Connector_Sabre_Node::removeETagPropertyForPath($path);
}
diff --git a/lib/filesystemview.php b/lib/filesystemview.php
index 02a0b521053..2950ced5f9e 100644
--- a/lib/filesystemview.php
+++ b/lib/filesystemview.php
@@ -451,8 +451,9 @@ class OC_FilesystemView {
OC_Filesystem::signal_post_write,
array( OC_Filesystem::signal_param_path => $path2)
);
- } else { // no real copy, file comes from somewhere else, e.g. version rollback -> just update the file cache without all the other post_write actions
+ } else { // no real copy, file comes from somewhere else, e.g. version rollback -> just update the file cache and the webdav properties without all the other post_write actions
OC_FileCache_Update::update($path2, $this->fakeRoot);
+ OC_Filesystem::removeETagHook(array("path" => $path2), $this->fakeRoot);
}
return $result;
}