From db1c5966fbd64827498536e5f224f9c060cf3414 Mon Sep 17 00:00:00 2001 From: larsbonczek <44197504+larsbonczek@users.noreply.github.com> Date: Tue, 22 Mar 2022 17:30:01 +0100 Subject: [PATCH] Fix encoding of Content-Disposition header URL-encode file name in Content-Disposition header for file download. fixes box/spout#878 --- src/Spout/Writer/WriterAbstract.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Spout/Writer/WriterAbstract.php b/src/Spout/Writer/WriterAbstract.php index fa43c97..fcc5c6d 100644 --- a/src/Spout/Writer/WriterAbstract.php +++ b/src/Spout/Writer/WriterAbstract.php @@ -140,8 +140,8 @@ abstract class WriterAbstract implements WriterInterface $this->globalFunctionsHelper->header('Content-Type: ' . static::$headerContentType); $this->globalFunctionsHelper->header( 'Content-Disposition: attachment; ' . - 'filename="' . rawurldecode($this->outputFilePath) . '"; ' . - 'filename*=UTF-8\'\'' . rawurldecode($this->outputFilePath) + 'filename="' . rawurlencode($this->outputFilePath) . '"; ' . + 'filename*=UTF-8\'\'' . rawurlencode($this->outputFilePath) ); /*