]> source.dussan.org Git - nextcloud-server.git/commitdiff
don't send delete for every single file if a folder gets deleted
authorBjoern Schiessle <schiessle@owncloud.com>
Thu, 20 Feb 2014 13:08:17 +0000 (14:08 +0100)
committerBjoern Schiessle <schiessle@owncloud.com>
Thu, 20 Feb 2014 13:08:17 +0000 (14:08 +0100)
lib/connector/sabre/directory.php

index 3cccf6ef3d0fbaae9cc83b795b0ac8a468560df9..6d386d35fb1638db818557684cec8b77fd90544d 100644 (file)
@@ -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);
        }
 
        /**