summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_external/lib/Lib/Storage/FTP.php17
-rw-r--r--lib/private/Files/Storage/Common.php5
2 files changed, 21 insertions, 1 deletions
diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php
index 2af145ad4a2..d9e5e2a0d5a 100644
--- a/apps/files_external/lib/Lib/Storage/FTP.php
+++ b/apps/files_external/lib/Lib/Storage/FTP.php
@@ -35,6 +35,7 @@
namespace OCA\Files_External\Lib\Storage;
use Icewind\Streams\CallbackWrapper;
+use Icewind\Streams\IteratorDirectory;
use Icewind\Streams\RetryWrapper;
class FTP extends StreamWrapper {
@@ -136,6 +137,22 @@ class FTP extends StreamWrapper {
return false;
}
+ public function opendir($path) {
+ $dh = parent::opendir($path);
+ if (is_resource($dh)) {
+ $files = [];
+ while (($file = readdir($dh)) !== false) {
+ if ($file != '.' && $file != '..' && strpos($file, '#') === false) {
+ $files[] = $file;
+ }
+ }
+ return IteratorDirectory::wrap($files);
+ } else {
+ return false;
+ }
+ }
+
+
public function writeBack($tmpFile, $path) {
$this->uploadFile($tmpFile, $path);
unlink($tmpFile);
diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php
index 6c57405619a..a62b7d727fb 100644
--- a/lib/private/Files/Storage/Common.php
+++ b/lib/private/Files/Storage/Common.php
@@ -876,7 +876,10 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
while (($file = readdir($dh)) !== false) {
if (!Filesystem::isIgnoredDir($file) && !Filesystem::isFileBlacklisted($file)) {
$childPath = $basePath . '/' . trim($file, '/');
- yield $this->getMetaData($childPath);
+ $metadata = $this->getMetaData($childPath);
+ if ($metadata !== null) {
+ yield $metadata;
+ }
}
}
}