Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Commit

Permalink
Fix encoding of Content-Disposition header
Browse files Browse the repository at this point in the history
URL-encode file name in Content-Disposition header for file download.

fixes #878
  • Loading branch information
larsbonczek authored and adrilo committed Mar 26, 2022
1 parent cc42c1d commit 0739e04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Spout/Writer/WriterAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ public function openToBrowser($outputFileName)
$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)
);

/*
Expand Down

0 comments on commit 0739e04

Please sign in to comment.