From 2cdffeb8ad7bc90c135a19bcdc7d4b6cb5c256b3 Mon Sep 17 00:00:00 2001 From: oleibman <10341515+oleibman@users.noreply.github.com> Date: Fri, 11 Mar 2022 23:51:59 -0800 Subject: [PATCH] WIP Remove + From Mode in BaseWriter (#2657) BaseWriter openFileHandle opens its output file with mode `wb+`. We don't appear to attempt any reads on the file after it is opened in write mode, so `wb` should be sufficient. This may have been a factor in the need for PR #2326, and is likely to be responsible for issue #2372. --- src/PhpSpreadsheet/Writer/BaseWriter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/Writer/BaseWriter.php b/src/PhpSpreadsheet/Writer/BaseWriter.php index 7811a2a0ed..7a3fa3696a 100644 --- a/src/PhpSpreadsheet/Writer/BaseWriter.php +++ b/src/PhpSpreadsheet/Writer/BaseWriter.php @@ -115,7 +115,7 @@ public function openFileHandle($filename): void return; } - $mode = 'wb+'; + $mode = 'wb'; $scheme = parse_url($filename, PHP_URL_SCHEME); if ($scheme === 's3') { $mode = 'w';