From: Thomas Müller Date: Tue, 24 Sep 2013 11:53:32 +0000 (+0200) Subject: adding file_exists check just to be on the save side X-Git-Tag: v6.0.0alpha2~126^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6c5466a540340a22e487d71a2605dcda3498a658;p=nextcloud-server.git adding file_exists check just to be on the save side --- diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php index 9e0fe5e64e7..a50098df793 100644 --- a/lib/connector/sabre/directory.php +++ b/lib/connector/sabre/directory.php @@ -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();