Merge pull request #30579 from nextcloud/backport/30565/stable21

[stable21] Fix fail when keys/files folder already exists
This commit is contained in:
Vincent Petry 2022-01-11 14:07:23 +01:00 committed by GitHub
commit 89504e1aed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -740,7 +740,11 @@ class Encryption extends Wrapper {
if ($sourceStorage->is_dir($sourceInternalPath)) {
$dh = $sourceStorage->opendir($sourceInternalPath);
$result = $this->mkdir($targetInternalPath);
if (!$this->is_dir($targetInternalPath)) {
$result = $this->mkdir($targetInternalPath);
} else {
$result = true;
}
if (is_resource($dh)) {
while ($result and ($file = readdir($dh)) !== false) {
if (!Filesystem::isIgnoredDir($file)) {