summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2013-10-01 22:33:58 +0200
committerRobin Appelman <icewind@owncloud.com>2013-10-01 22:33:58 +0200
commitde43515cfad858224393f5cc5bfb35c07a1820b0 (patch)
tree0da6db5f76df0886205d68c0f7a4b80d2f832c17
parent29deef38b27f2b33eec8925cab7f6f323a35ea96 (diff)
downloadnextcloud-server-de43515cfad858224393f5cc5bfb35c07a1820b0.tar.gz
nextcloud-server-de43515cfad858224393f5cc5bfb35c07a1820b0.zip
fix recursive delete for smb
-rw-r--r--apps/files_external/lib/streamwrapper.php8
1 files changed, 8 insertions, 0 deletions
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;