diff options
Diffstat (limited to 'apps/files_trashbin/lib/trashbin.php')
-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 (?,?,?,?)"); |