Merge pull request #30576 from nextcloud/backport/30565/stable23

[stable23] Fix fail when keys/files folder already exists
This commit is contained in:
Louis 2022-01-11 10:44:10 +01:00 committed by GitHub
commit ad5501a464
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -768,7 +768,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)) {