[Pkg-owncloud-commits] [owncloud] 09/90: Check if files are deletable before trying to delete them

David Prévot taffit at moszumanska.debian.org
Fri Feb 6 21:10:40 UTC 2015


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

taffit pushed a commit to branch master
in repository owncloud.

commit a05fc9dc73723b66968dfafd9834a2290d6a7960
Author: Robin Appelman <icewind at owncloud.com>
Date:   Thu Nov 20 16:34:33 2014 +0100

    Check if files are deletable before trying to delete them
---
 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 aed53d5..538bdf9 100644
--- a/apps/files/ajax/delete.php
+++ b/apps/files/ajax/delete.php
@@ -27,7 +27,9 @@ $success = true;
 //Now delete
 foreach ($files as $file) {
 	if (\OC\Files\Filesystem::file_exists($dir . '/' . $file) &&
-			!\OC\Files\Filesystem::unlink($dir . '/' . $file)) {
+		!(\OC\Files\Filesystem::isDeletable($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