From 713faa0fc027d70136465c41c01d401e5d54a009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Pablo=20Villaf=C3=A1=C3=B1ez?= Date: Wed, 25 Jan 2017 17:21:20 +0100 Subject: [PATCH] Use the expected method depending on the target being a file or folder Signed-off-by: Morris Jobke --- apps/files_trashbin/lib/Trashbin.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 2e66a6b96e..78f0c9212f 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -256,7 +256,11 @@ class Trashbin { } if ($sourceStorage->file_exists($sourceInternalPath)) { // failed to delete the original file, abort - $sourceStorage->unlink($sourceInternalPath); + if ($sourceStorage->is_dir($sourceInternalPath)) { + $sourceStorage->rmdir($sourceInternalPath); + } else { + $sourceStorage->unlink($sourceInternalPath); + } return false; }