From: Thomas Müller Date: Tue, 24 Sep 2013 11:54:18 +0000 (+0200) Subject: duplicate code :sigh: - will fix this in a second pr X-Git-Tag: v6.0.0alpha2~126^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e9eb34f1872a0237b7474496e8c759a4a3ef1156;p=nextcloud-server.git duplicate code :sigh: - will fix this in a second pr --- diff --git a/lib/connector/sabre/file.php b/lib/connector/sabre/file.php index 61bdcd5e0ae..433b1148552 100644 --- a/lib/connector/sabre/file.php +++ b/lib/connector/sabre/file.php @@ -74,7 +74,14 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D } // rename to correct path - \OC\Files\Filesystem::rename($partpath, $this->path); + $renameOkay = \OC\Files\Filesystem::rename($partpath, $this->path); + $fileExists = \OC\Files\Filesystem::file_exists($this->path); + 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(); + } + //allow sync clients to send the mtime along in a header $mtime = OC_Request::hasModificationTime();