]> source.dussan.org Git - nextcloud-server.git/commitdiff
Dont delete versions as local files
authorRobin Appelman <icewind@owncloud.com>
Fri, 4 Jul 2014 15:57:43 +0000 (17:57 +0200)
committerRobin Appelman <icewind@owncloud.com>
Mon, 7 Jul 2014 13:49:08 +0000 (15:49 +0200)
apps/files_versions/lib/versions.php

index 4e6004808d25494cfe2a84f3366844200d72f58c..5035defd60b05b8b623bb3a2d3c766f5a7a059e5 100644 (file)
@@ -142,15 +142,14 @@ class Storage {
 
                if (!\OC\Files\Filesystem::file_exists($path)) {
 
-                       $versions_fileview = new \OC\Files\View('/' . $uid . '/files_versions');
+                       $view = new \OC\Files\View('/' . $uid . '/files_versions');
 
-                       $abs_path = $versions_fileview->getLocalFile($filename . '.v');
                        $versions = self::getVersions($uid, $filename);
                        if (!empty($versions)) {
                                foreach ($versions as $v) {
-                                       \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $abs_path . $v['version']));
-                                       unlink($abs_path . $v['version']);
-                                       \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $abs_path . $v['version']));
+                                       \OC_Hook::emit('\OCP\Versions', 'preDelete', array('path' => $path . $v['version']));
+                                       $view->unlink($filename . '.v' . $v['version']);
+                                       \OC_Hook::emit('\OCP\Versions', 'delete', array('path' => $path . $v['version']));
                                }
                        }
                }