Skip to content

Commit

Permalink
Make sure that a empty directory can still be deleted when copied fro…
Browse files Browse the repository at this point in the history
…m another storage

Signed-off-by: Julius Härtl <jus@bitgrid.net>
  • Loading branch information
juliusknorr authored and skjnldsv committed Aug 13, 2021
1 parent 8a14f64 commit bc3c463
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/private/Files/Storage/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,7 @@ public function copyFromStorage(IStorage $sourceStorage, $sourceInternalPath, $t
$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);
Expand Down

0 comments on commit bc3c463

Please sign in to comment.