]> 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>
Tue, 24 Sep 2013 11:53:32 +0000 (13:53 +0200)
lib/connector/sabre/directory.php

index 9e0fe5e64e73224a10601df1a5342f9e90ba86d1..a50098df793dcfcff7fb3c182633f2c08536eb17 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();