diff options
author | Robin Appelman <robin@icewind.nl> | 2025-06-12 19:48:32 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2025-06-24 16:27:27 +0200 |
commit | 1d2b991bda4d74499c55783bc98b317b2e589ba4 (patch) | |
tree | 078c5d80c07ae83a0ffb4defa4709d32b2aeeba6 | |
parent | d161e07cf7e335faa531b00ba04272aad1473c9d (diff) | |
download | nextcloud-server-copyr-no-empty-newfile.tar.gz nextcloud-server-copyr-no-empty-newfile.zip |
fix: don't create an empty file before writing the contents in OC_Util::copyrcopyr-no-empty-newfile
Signed-off-by: Robin Appelman <robin@icewind.nl>
-rw-r--r-- | lib/private/legacy/OC_Util.php | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 87447af8adc..41ac787aa80 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -187,14 +187,13 @@ class OC_Util { $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); } } } |