summaryrefslogtreecommitdiffstats
path: root/apps/files_versions/lib
diff options
context:
space:
mode:
authorBjörn Schießle <schiessle@owncloud.com>2013-03-08 11:27:25 +0100
committerBjörn Schießle <schiessle@owncloud.com>2013-03-08 11:27:25 +0100
commit8d26400cb5427763b0562da8799bea52f4eae21e (patch)
tree2c892bd70c3c2563048c6a7cad76cedb94c213ed /apps/files_versions/lib
parent45869afa5ac718e11c3d2e3bccdb501a022cfc24 (diff)
downloadnextcloud-server-8d26400cb5427763b0562da8799bea52f4eae21e.tar.gz
nextcloud-server-8d26400cb5427763b0562da8799bea52f4eae21e.zip
remove some debug output; move code to the right function
Diffstat (limited to 'apps/files_versions/lib')
-rw-r--r--apps/files_versions/lib/hooks.php6
-rw-r--r--apps/files_versions/lib/versions.php8
2 files changed, 8 insertions, 6 deletions
diff --git a/apps/files_versions/lib/hooks.php b/apps/files_versions/lib/hooks.php
index 6e81286052f..7891b20e92f 100644
--- a/apps/files_versions/lib/hooks.php
+++ b/apps/files_versions/lib/hooks.php
@@ -21,12 +21,6 @@ class Hooks {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$path = $params[\OC\Files\Filesystem::signal_param_path];
- $pos = strrpos($path, '.part');
- if ($pos) {
- error_log("old path: $path");
- $path = substr($path, 0, $pos);
- error_log("new path: $path");
- }
if($path<>'') {
Storage::store($path);
}
diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php
index 79b16f2586f..20611c61ec7 100644
--- a/apps/files_versions/lib/versions.php
+++ b/apps/files_versions/lib/versions.php
@@ -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');