]> source.dussan.org Git - nextcloud-server.git/commitdiff
Don't unlink old renamed file if stream copy failed
authorMichael Gapczynski <mtgap@owncloud.com>
Sat, 13 Apr 2013 19:04:46 +0000 (15:04 -0400)
committerMichael Gapczynski <mtgap@owncloud.com>
Sat, 13 Apr 2013 19:04:46 +0000 (15:04 -0400)
lib/files/view.php

index b0e82919359464681f2d2bc2e435d3ae9dfbbc5b..d2d1a99818bfd92931348f7b2471b1843aac3d22 100644 (file)
@@ -370,7 +370,9 @@ class View {
                                        $target = $this->fopen($path2 . $postFix2, 'w');
                                        list($count, $result) = \OC_Helper::streamCopy($source, $target);
                                        list($storage1, $internalPath1) = Filesystem::resolvePath($absolutePath1 . $postFix1);
-                                       $storage1->unlink($internalPath1);
+                                       if ($result !== false) {
+                                               $storage1->unlink($internalPath1);
+                                       }
                                }
                                if ($this->fakeRoot == Filesystem::getRoot() && $result !== false) {
                                        \OC_Hook::emit(