diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-24 13:54:18 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-24 13:54:18 +0200 |
commit | e9eb34f1872a0237b7474496e8c759a4a3ef1156 (patch) | |
tree | 7c81c4a0348a90790b2f92f5b6bdfc8a78c0ab4b | |
parent | 6c5466a540340a22e487d71a2605dcda3498a658 (diff) | |
download | nextcloud-server-e9eb34f1872a0237b7474496e8c759a4a3ef1156.tar.gz nextcloud-server-e9eb34f1872a0237b7474496e8c759a4a3ef1156.zip |
duplicate code :sigh: - will fix this in a second pr
-rw-r--r-- | lib/connector/sabre/file.php | 9 |
1 files changed, 8 insertions, 1 deletions
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(); |