Skip to content

Commit

Permalink
Fix nextcloud#23373 fclose on non-opened stream
Browse files Browse the repository at this point in the history
Signed-off-by: tsdicloud <bernd.rederlechner@t-systems.com>
  • Loading branch information
tsdicloud authored and tsdicloud committed Mar 24, 2021
1 parent 4287b6f commit c5b3925
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/private/Files/ObjectStore/S3ObjectTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,13 @@ public function writeObject($urn, $stream) {
} else {
throw $e;
}
} finally {
// this handles [S3] fclose(): supplied resource is not a valid stream resource #23373
// see https://stackoverflow.com/questions/11247507/fclose-18-is-not-a-valid-stream-resource/11247555
// which also recommends the solution
if (is_resource($countStream)) {
fclose($countStream);
}
}
}

Expand Down

0 comments on commit c5b3925

Please sign in to comment.