]> source.dussan.org Git - nextcloud-server.git/commitdiff
Do not trash part files, delete directly
authorVincent Petry <pvince81@owncloud.com>
Tue, 21 Apr 2015 16:28:15 +0000 (18:28 +0200)
committerVincent Petry <pvince81@owncloud.com>
Tue, 21 Apr 2015 16:28:15 +0000 (18:28 +0200)
apps/files_trashbin/lib/storage.php
lib/private/connector/sabre/file.php

index 61e0816fd248b0159f56c37ac1809f04aee9d1d0..418d7d2f1fd29656e71478a1d70daefd19b3f4c7 100644 (file)
@@ -84,7 +84,10 @@ class Storage extends Wrapper {
         * @param string $path
         */
        public function unlink($path) {
-               if (self::$disableTrash || !\OC_App::isEnabled('files_trashbin')) {
+               if (self::$disableTrash
+                       || !\OC_App::isEnabled('files_trashbin')
+                       || (pathinfo($path, PATHINFO_EXTENSION) === 'part')
+               ) {
                        return $this->storage->unlink($path);
                }
                $normalized = Filesystem::normalizePath($this->mountPoint . '/' . $path);
index dc678c0894f87554878b98afe86953baab2ebfb2..100aba13668d50b589fe7820af62bc911f786c92 100644 (file)
@@ -117,7 +117,7 @@ class File extends Node implements IFile {
                        $target = $storage->fopen($internalPartPath, 'wb');
                        if ($target === false) {
                                \OC_Log::write('webdav', '\OC\Files\Filesystem::fopen() failed', \OC_Log::ERROR);
-                               $this->fileView->unlink($partFilePath);
+                               $storage->unlink($internalPartPath);
                                // because we have no clue about the cause we can only throw back a 500/Internal Server Error
                                throw new Exception('Could not write file contents');
                        }
@@ -166,7 +166,7 @@ class File extends Node implements IFile {
                                        $fileExists = $storage->file_exists($internalPath);
                                        if ($renameOkay === false || $fileExists === false) {
                                                \OC_Log::write('webdav', '\OC\Files\Filesystem::rename() failed', \OC_Log::ERROR);
-                                               $this->fileView->unlink($partFilePath);
+                                               $storage->unlink($internalPartPath);
                                                throw new Exception('Could not rename part file to final file');
                                        }
                                } catch (\OCP\Files\LockNotAcquiredException $e) {