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: v5.0.13~63^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=245a0260a95e0d81bc08b2488f0b8ecd8f1ff7f1;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 b0d7102c6d9..543bf376d26 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();