mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Merge pull request #52937 from nextcloud/fix/s3-versions³
fix(files_versions): only close stream if still open, fixing S3
This commit is contained in:
commit
0e20d9e736
1 changed files with 7 additions and 1 deletions
|
|
@ -430,11 +430,17 @@ class Storage {
|
|||
} else {
|
||||
$target = $storage2->fopen($internalPath2, 'w');
|
||||
$result = $target !== false;
|
||||
if ($target !== false) {
|
||||
if ($result) {
|
||||
[, $result] = Files::streamCopy($source, $target, true);
|
||||
}
|
||||
// explicit check as S3 library closes streams already
|
||||
if (is_resource($target)) {
|
||||
fclose($target);
|
||||
}
|
||||
}
|
||||
}
|
||||
// explicit check as S3 library closes streams already
|
||||
if (is_resource($source)) {
|
||||
fclose($source);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue