Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: don't create an empty file before writing the contents in OC_Uti…
…l::copyr

Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Jun 24, 2025
commit 1d2b991bda4d74499c55783bc98b317b2e589ba4
3 changes: 1 addition & 2 deletions lib/private/legacy/OC_Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,13 @@ public static function copyr($source, \OCP\Files\Folder $target) {
$child = $target->newFolder($file);
self::copyr($source . '/' . $file, $child);
} else {
$child = $target->newFile($file);
$sourceStream = fopen($source . '/' . $file, 'r');
if ($sourceStream === false) {
$logger->error(sprintf('Could not fopen "%s"', $source . '/' . $file), ['app' => 'core']);
closedir($dir);
return;
}
$child->putContent($sourceStream);
$target->newFile($file, $sourceStream);
}
}
}
Expand Down
Loading