From fa068641a77a00f7eb540aff1f27465a7c093276 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 1 Oct 2013 22:33:58 +0200 Subject: [PATCH] fix recursive delete for smb --- apps/files_external/lib/streamwrapper.php | 8 ++++++++ 1 file changed, 8 insertions(+) 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; -- 2.39.5