Merge pull request #29158 from nextcloud/backport/24185/stable20

[stable20] Properly handle folder deletion on external s3 storage
pull/29297/head
Daniel 3 years ago committed by GitHub
commit 400da8564d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -314,6 +314,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
}
// we reached the end when the list is no longer truncated
} while ($objects['IsTruncated']);
$this->deleteObject($path);
} catch (S3Exception $e) {
\OC::$server->getLogger()->logException($e, ['app' => 'files_external']);
return false;

@ -612,6 +612,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
$dh = $sourceStorage->opendir($sourceInternalPath);
$result = $this->mkdir($targetInternalPath);
if (is_resource($dh)) {
$result = true;
while ($result and ($file = readdir($dh)) !== false) {
if (!Filesystem::isIgnoredDir($file)) {
$result &= $this->copyFromStorage($sourceStorage, $sourceInternalPath . '/' . $file, $targetInternalPath . '/' . $file);

Loading…
Cancel
Save