]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use the expected method depending on the target being a file or folder 3998/head
authorJuan Pablo Villafáñez <jvillafanez@solidgear.es>
Wed, 25 Jan 2017 16:21:20 +0000 (17:21 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Thu, 23 Mar 2017 00:02:09 +0000 (18:02 -0600)
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
apps/files_trashbin/lib/Trashbin.php

index 2e66a6b96e12f0f919765e3cf4b8ddbd238fc116..78f0c9212f9e696c47fd205b53ac97f502d62262 100644 (file)
@@ -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;
                }