]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix recursive delete for smb
authorRobin Appelman <icewind@owncloud.com>
Tue, 1 Oct 2013 20:33:58 +0000 (22:33 +0200)
committerRobin Appelman <icewind@owncloud.com>
Tue, 1 Oct 2013 20:33:58 +0000 (22:33 +0200)
apps/files_external/lib/streamwrapper.php

index a110c006529923de16f4af2ffbe8163dfe71442a..4a63dfb6e0277b6c6fd9d5286fe7a42257ba7f9f 100644 (file)
@@ -17,6 +17,14 @@ abstract class StreamWrapper extends Common {
 
        public function rmdir($path) {
                if ($this->file_exists($path)) {
+                       $dh = $this->opendir($path);
+                       while (($file = readdir($dh)) !== false) {
+                               if ($this->is_dir($path . '/' . $file)) {
+                                       $this->rmdir($path . '/' . $file);
+                               } else {
+                                       $this->unlink($path . '/' . $file);
+                               }
+                       }
                        $success = rmdir($this->constructUrl($path));
                        clearstatcache();
                        return $success;