@@ -30,18 +30,18 @@ |
||
| 30 | 30 | * @since 7.0.0 |
| 31 | 31 | */ |
| 32 | 32 | class DownloadResponse extends Response { |
| 33 | - /** |
|
| 34 | - * Creates a response that prompts the user to download the file |
|
| 35 | - * @param string $filename the name that the downloaded file should have |
|
| 36 | - * @param string $contentType the mimetype that the downloaded file should have |
|
| 37 | - * @since 7.0.0 |
|
| 38 | - */ |
|
| 39 | - public function __construct(string $filename, string $contentType) { |
|
| 40 | - parent::__construct(); |
|
| 33 | + /** |
|
| 34 | + * Creates a response that prompts the user to download the file |
|
| 35 | + * @param string $filename the name that the downloaded file should have |
|
| 36 | + * @param string $contentType the mimetype that the downloaded file should have |
|
| 37 | + * @since 7.0.0 |
|
| 38 | + */ |
|
| 39 | + public function __construct(string $filename, string $contentType) { |
|
| 40 | + parent::__construct(); |
|
| 41 | 41 | |
| 42 | - $filename = strtr($filename, ['"' => '\\"', '\\' => '\\\\']); |
|
| 42 | + $filename = strtr($filename, ['"' => '\\"', '\\' => '\\\\']); |
|
| 43 | 43 | |
| 44 | - $this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"'); |
|
| 45 | - $this->addHeader('Content-Type', $contentType); |
|
| 46 | - } |
|
| 44 | + $this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"'); |
|
| 45 | + $this->addHeader('Content-Type', $contentType); |
|
| 46 | + } |
|
| 47 | 47 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | $filename = strtr($filename, ['"' => '\\"', '\\' => '\\\\']); |
| 43 | 43 | |
| 44 | - $this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"'); |
|
| 44 | + $this->addHeader('Content-Disposition', 'attachment; filename="'.$filename.'"'); |
|
| 45 | 45 | $this->addHeader('Content-Type', $contentType); |
| 46 | 46 | } |
| 47 | 47 | } |