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 15, 2021
1 parent d585a4f commit fe7f47b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/private/Files/ObjectStore/S3ObjectTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,14 @@ 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);
}
}

fclose($countStream);
}

/**
Expand Down

0 comments on commit fe7f47b

Please sign in to comment.