summaryrefslogtreecommitdiffstats
path: root/apps/files_versions
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-03-08 03:05:28 -0800
committerBernhard Posselt <nukeawhale@gmail.com>2013-03-08 03:05:28 -0800
commit0525bbd73c9015499ba92d1ac654b980aaca35b2 (patch)
tree9038772de322c4e61b899d2dc188d9bb42953532 /apps/files_versions
parent308c85090e8815339a24e4032466ffddfc0240e2 (diff)
parent8d26400cb5427763b0562da8799bea52f4eae21e (diff)
downloadnextcloud-server-0525bbd73c9015499ba92d1ac654b980aaca35b2.tar.gz
nextcloud-server-0525bbd73c9015499ba92d1ac654b980aaca35b2.zip
Merge pull request #2189 from owncloud/versioning_sync_client
fix versioning for the sync client - distinguish between touch and write operation
Diffstat (limited to 'apps/files_versions')
-rw-r--r--apps/files_versions/lib/versions.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index c37133cf32c..20611c61ec7 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -61,7 +61,7 @@ class Storage {
}
return false;
}
-
+
/**
* write to the database how much space is in use for versions
*
@@ -82,6 +82,14 @@ class Storage {
*/
public static function store($filename) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+
+ // if the file gets streamed we need to remove the .part extension
+ // to get the right target
+ $ext = pathinfo($filename, PATHINFO_EXTENSION);
+ if ($ext === 'part') {
+ $filename = substr($filename, 0, strlen($filename)-5);
+ }
+
list($uid, $filename) = self::getUidAndFilename($filename);
$files_view = new \OC\Files\View('/'.$uid .'/files');