Skip to content

Commit

Permalink
Escape name only
Browse files Browse the repository at this point in the history
  • Loading branch information
VicDeo committed Sep 24, 2015
1 parent bcdf951 commit 0311a06
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/TarStreamer.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,13 @@ public function sendHeaders($archiveName = 'archive.tar', $contentType = 'applic
'Accept-Ranges' => 'bytes',
'Connection' => 'Keep-Alive',
'Content-Type' => $contentType,
'Content-Disposition' => 'attachment; filename="' . $archiveName . '";',
'Content-Disposition' => 'attachment; filename="' . $encodedArchiveName . '";',
'Cache-Control' => 'public, must-revalidate',
'Content-Transfer-Encoding' => 'binary',
];

foreach ($headers as $key => $value){
$encodedValue = rawurlencode($value);
header("$key: $encodedValue");
header("$key: $value");
}
}

Expand Down

0 comments on commit 0311a06

Please sign in to comment.