[Pkg-owncloud-commits] [owncloud] 30/34: no error if we try to delete a file which no longer exists

David Prévot taffit at moszumanska.debian.org
Thu Nov 13 19:37:15 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag v6.0.6
in repository owncloud.

commit 9ea90ac82fcc77b4d0e78cd8d1d86362286091ac
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Fri Aug 8 16:16:01 2014 +0200

    no error if we try to delete a file which no longer exists
---
 apps/files/ajax/delete.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php
index c69f5a8..e200218 100644
--- a/apps/files/ajax/delete.php
+++ b/apps/files/ajax/delete.php
@@ -17,7 +17,9 @@ $success = true;
 
 //Now delete
 foreach ($files as $file) {
-	if (($dir === '' && $file === 'Shared') || !\OC\Files\Filesystem::unlink($dir . '/' . $file)) {
+	if (($dir === '' && $file === 'Shared') ||
+		(\OC\Files\Filesystem::file_exists($dir . '/' . $file) &&
+			!\OC\Files\Filesystem::unlink($dir . '/' . $file))) {
 		$filesWithError .= $file . "\n";
 		$success = false;
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list