diff options
author | Robin Appelman <icewind@owncloud.com> | 2015-01-28 15:35:49 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2015-01-29 15:39:58 +0100 |
commit | d4c4e2a3221bdba82c60e5428a5b151b4f21ad10 (patch) | |
tree | 22b6ea78bed401d97879af4cbb0e1d9e4ef396e5 /apps/files_trashbin/lib | |
parent | 2124540d1d9f500423e5149b1490ed489788ff1d (diff) | |
download | nextcloud-server-d4c4e2a3221bdba82c60e5428a5b151b4f21ad10.tar.gz nextcloud-server-d4c4e2a3221bdba82c60e5428a5b151b4f21ad10.zip |
Detect failed deletes in the trashbin
Diffstat (limited to 'apps/files_trashbin/lib')
-rw-r--r-- | apps/files_trashbin/lib/trashbin.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/apps/files_trashbin/lib/trashbin.php b/apps/files_trashbin/lib/trashbin.php index 0576be66b4b..ead7f3e09ca 100644 --- a/apps/files_trashbin/lib/trashbin.php +++ b/apps/files_trashbin/lib/trashbin.php @@ -180,6 +180,11 @@ class Trashbin { } \OC_FileProxy::$enabled = $proxyStatus; + if ($view->file_exists('/files/' . $file_path)) { // failed to delete the original file, abort + $view->unlink($trashPath); + return false; + } + if ($sizeOfAddedFiles !== false) { $size = $sizeOfAddedFiles; $query = \OC_DB::prepare("INSERT INTO `*PREFIX*files_trash` (`id`,`timestamp`,`location`,`user`) VALUES (?,?,?,?)"); |