From db89d1cec8291b64f8a49574564c073c3a92b96a Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 16 Jul 2015 15:44:10 +0200 Subject: [PATCH] handle rmdir on files for ftp storages --- apps/files_external/lib/streamwrapper.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php index f2438a5487..387667a81a 100644 --- a/apps/files_external/lib/streamwrapper.php +++ b/apps/files_external/lib/streamwrapper.php @@ -40,8 +40,11 @@ abstract class StreamWrapper extends Common { } public function rmdir($path) { - if ($this->file_exists($path) && $this->isDeletable($path)) { + if ($this->is_dir($path) && $this->isDeletable($path)) { $dh = $this->opendir($path); + if (!is_resource($dh)) { + return false; + } while (($file = readdir($dh)) !== false) { if ($this->is_dir($path . '/' . $file)) { $this->rmdir($path . '/' . $file);