]> source.dussan.org Git - nextcloud-server.git/commitdiff
adding file_exists check just to be on the save side
authorThomas Müller <thomas.mueller@tmit.eu>
Tue, 24 Sep 2013 11:53:32 +0000 (13:53 +0200)
committerThomas Müller <thomas.mueller@tmit.eu>
Wed, 2 Oct 2013 20:13:59 +0000 (22:13 +0200)
lib/connector/sabre/directory.php

index b0d7102c6d960c39fc1af97a022aa01dc1a3ce1a..543bf376d26cd4ca3de0a9b514aa9492e2e1fdd7 100644 (file)
@@ -89,7 +89,8 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
 
                        // rename to correct path
                        $renameOkay = \OC\Files\Filesystem::rename($partpath, $newPath);
-                       if (!$renameOkay) {
+                       $fileExists = \OC\Files\Filesystem::file_exists($newPath);
+                       if ($renameOkay === false || $fileExists === false) {
                                \OC_Log::write('webdav', '\OC\Files\Filesystem::rename() failed', \OC_Log::ERROR);
                                \OC\Files\Filesystem::unlink($partpath);
                                throw new Sabre_DAV_Exception();