Skip to content

Commit 55e4223

Browse files
authored
Merge pull request #59828 from nextcloud/backport/59597/stable32
[stable32] fix(s3): ignore prefixes with repeating delimiters
2 parents b8ad34c + 8d4fa6f commit 55e4223

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

apps/files_external/lib/Lib/Storage/AmazonS3.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,12 @@ public function getDirectoryContent(string $directory): \Traversable {
645645
// sub folders
646646
if (is_array($result['CommonPrefixes'])) {
647647
foreach ($result['CommonPrefixes'] as $prefix) {
648+
if (preg_match('/\/{2,}$/', $prefix['Prefix'])) {
649+
$this->logger->warning('Detected a repeating delimiter in prefix \'' . $prefix['Prefix']
650+
. '\'. This is unsupported and its contents have been ignored.');
651+
continue;
652+
}
653+
648654
$dir = $this->getDirectoryMetaData($prefix['Prefix']);
649655
if ($dir) {
650656
yield $dir;

0 commit comments

Comments
 (0)