summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-08-13 15:32:53 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-08-13 15:32:53 +0200
commit5296ef64cc58bbaf4cca715cd47bc37a6c1a3e69 (patch)
tree6d56404215ce7a3c657eceb164e37746bb483168
parente4e4b6f90267d139c622a6b24992fbbc3eaeec55 (diff)
parentcb9aa372c89b8871bb3ad932b773e67aae77e239 (diff)
downloadnextcloud-server-5296ef64cc58bbaf4cca715cd47bc37a6c1a3e69.tar.gz
nextcloud-server-5296ef64cc58bbaf4cca715cd47bc37a6c1a3e69.zip
Merge pull request #18258 from owncloud/stable8-backport-17680
[stable8] handle rmdir on files for ftp storages
-rw-r--r--apps/files_external/lib/streamwrapper.php5
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);