From 6c5466a540340a22e487d71a2605dcda3498a658 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20M=C3=BCller?= <thomas.mueller@tmit.eu>
Date: Tue, 24 Sep 2013 13:53:32 +0200
Subject: [PATCH] adding file_exists check just to be on the save side

---
 lib/connector/sabre/directory.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php
index 9e0fe5e64e..a50098df79 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();
-- 
GitLab