Merge pull request #58255 from nextcloud/backport/56505/stable31

This commit is contained in:
Benjamin Gaussorgues 2026-02-12 08:50:06 +01:00 committed by GitHub
commit 3c504dce80
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -261,13 +261,16 @@ class AmazonS3 extends Common {
// to delete all objects prefixed with the path.
do {
// instead of the iterator, manually loop over the list ...
$objects = $connection->listObjects($params);
$objects = $connection->listObjectsV2($params);
// ... so we can delete the files in batches
if (isset($objects['Contents'])) {
$connection->deleteObjects([
'Bucket' => $this->bucket,
'Delete' => [
'Objects' => $objects['Contents']
'Objects' => array_map(fn (array $object) => [
'ETag' => $object['ETag'],
'Key' => $object['Key'],
], $objects['Contents'])
]
]);
$this->testTimeout();