diff options
-rw-r--r-- | apps/files_external/lib/streamwrapper.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php index b55bcf94af8..1f314df1a48 100644 --- a/apps/files_external/lib/streamwrapper.php +++ b/apps/files_external/lib/streamwrapper.php @@ -21,8 +21,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); |