From ab93d295625defcbca6cc01d1ffd9b7526e8bb6e Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Thu, 20 Feb 2014 14:08:17 +0100 Subject: [PATCH] don't send delete for every single file if a folder gets deleted --- lib/connector/sabre/directory.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/connector/sabre/directory.php b/lib/connector/sabre/directory.php index 3cccf6ef3d0..6d386d35fb1 100644 --- a/lib/connector/sabre/directory.php +++ b/lib/connector/sabre/directory.php @@ -225,14 +225,15 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa */ public function delete() { - if (!\OC\Files\Filesystem::isDeletable($this->path)) { + if ($this->path === '/Shared') { throw new \Sabre_DAV_Exception_Forbidden(); } - if ($this->path != "/Shared") { - foreach($this->getChildren() as $child) $child->delete(); - \OC\Files\Filesystem::rmdir($this->path); + + if (!\OC\Files\Filesystem::isDeletable($this->path)) { + throw new \Sabre_DAV_Exception_Forbidden(); } + \OC\Files\Filesystem::rmdir($this->path); } /** -- 2.39.5