From 7da8951c57b07d0ee90c16129367255e4217cb81 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 18 Nov 2024 17:35:09 +0100 Subject: 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 --- lib/private/Files/ObjectStore/S3ObjectTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/private/Files/ObjectStore/S3ObjectTrait.php b/lib/private/Files/ObjectStore/S3ObjectTrait.php index 2e625033751..dfe96294c69 100644 --- a/lib/private/Files/ObjectStore/S3ObjectTrait.php +++ b/lib/private/Files/ObjectStore/S3ObjectTrait.php @@ -144,7 +144,7 @@ trait S3ObjectTrait { // ($psrStream->isSeekable() && $psrStream->getSize() !== null) evaluates to true for a On-Seekable stream // so the optimisation does not apply - $buffer = new Psr7\Stream(fopen('php://memory', 'rwb+')); + $buffer = new Psr7\Stream(fopen('php://temp', 'rwb+')); Utils::copyToStream($psrStream, $buffer, $this->putSizeLimit); $buffer->seek(0); if ($buffer->getSize() < $this->putSizeLimit) { -- cgit v1.2.3