From: Robin Appelman Date: Tue, 1 Oct 2013 20:33:58 +0000 (+0200) Subject: fix recursive delete for smb X-Git-Tag: v6.0.0alpha2~53^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=de43515cfad858224393f5cc5bfb35c07a1820b0;p=nextcloud-server.git fix recursive delete for smb --- diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php index a110c006529..4a63dfb6e02 100644 --- a/apps/files_external/lib/streamwrapper.php +++ b/apps/files_external/lib/streamwrapper.php @@ -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;