Uniform behavour for tar and zip

This commit is contained in:
Victor Dubiniuk 2015-09-24 22:31:05 +03:00 committed by Thomas Müller
parent 027fb4e3fe
commit 057994f4aa
1 changed files with 6 additions and 1 deletions

View File

@ -48,7 +48,12 @@ class Streamer {
*/
public function sendHeaders($name){
$extension = $this->streamerInstance instanceof ZipStreamer ? '.zip' : '.tar';
$this->streamerInstance->sendHeaders($name . $extension);
$fullName = $name . $extension;
// ZipStreamer does not escape name in Content-Disposition atm
if ($this->streamerInstance instanceof ZipStreamer) {
$fullName = rawurlencode($fullName);
}
$this->streamerInstance->sendHeaders($fullName);
}
/**