diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-30 09:21:37 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2013-09-30 09:21:37 +0200 |
commit | 952433eae6cdf15e8615b4da682b81f4537b0ba0 (patch) | |
tree | d0adb161a3184fd6890df1eca8922f87ad300836 /lib/connector/sabre/directory.php | |
parent | 46e47be78272b76c6c569a8f1589d78828d72ec1 (diff) | |
parent | 5899485ca17045e93528c29d1ed63b02192c4191 (diff) | |
download | nextcloud-server-952433eae6cdf15e8615b4da682b81f4537b0ba0.tar.gz nextcloud-server-952433eae6cdf15e8615b4da682b81f4537b0ba0.zip |
Merge branch 'master' into move-aborted-upload-detection-into-plugin-master
Diffstat (limited to 'lib/connector/sabre/directory.php')
-rw-r--r-- | lib/connector/sabre/directory.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php index 29374f7a6cf..382bdf06df1 100644 --- a/lib/connector/sabre/directory.php +++ b/lib/connector/sabre/directory.php @@ -75,7 +75,13 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa \OC\Files\Filesystem::file_put_contents($partpath, $data); // rename to correct path - \OC\Files\Filesystem::rename($partpath, $newPath); + $renameOkay = \OC\Files\Filesystem::rename($partpath, $newPath); + $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(); + } // allow sync clients to send the mtime along in a header $mtime = OC_Request::hasModificationTime(); |