From bc3c46362abfb569a1919cdfca2762a0d15d520c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 17 Nov 2020 14:29:56 +0100 Subject: [PATCH] Make sure that a empty directory can still be deleted when copied from another storage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/private/Files/Storage/Common.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index 0814e2964928b..4c07426dd707a 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -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);