mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
fix: don't create an empty file before writing the contents in OC_Util::copyr
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
d161e07cf7
commit
1d2b991bda
1 changed files with 1 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue