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

David Prévot taffit at moszumanska.debian.org
Thu Aug 21 16:44:35 UTC 2014


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

taffit pushed a commit to branch master
in repository owncloud.

commit fe119300c7b2043eeaa110d99c789260ec2f5f7f
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 | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/apps/files/ajax/delete.php b/apps/files/ajax/delete.php
index 196bcce..aed53d5 100644
--- a/apps/files/ajax/delete.php
+++ b/apps/files/ajax/delete.php
@@ -26,7 +26,8 @@ $success = true;
 
 //Now delete
 foreach ($files as $file) {
-	if (!\OC\Files\Filesystem::unlink($dir . '/' . $file)) {
+	if (\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