Skip to content

Commit 573825c

Browse files
committed
fix: use php://temp instead of php://memory for multi-part upload buffer
this should reduce potential memory issues if the limit is set very high Signed-off-by: Robin Appelman <[email protected]>
1 parent 8995272 commit 573825c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/private/Files/ObjectStore/S3ObjectTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function writeObject($urn, $stream, ?string $mimetype = null) {
144144

145145
// ($psrStream->isSeekable() && $psrStream->getSize() !== null) evaluates to true for a On-Seekable stream
146146
// so the optimisation does not apply
147-
$buffer = new Psr7\Stream(fopen('php://memory', 'rwb+'));
147+
$buffer = new Psr7\Stream(fopen('php://temp', 'rwb+'));
148148
Utils::copyToStream($psrStream, $buffer, $this->putSizeLimit);
149149
$buffer->seek(0);
150150
if ($buffer->getSize() < $this->putSizeLimit) {

0 commit comments

Comments
 (0)