Page MenuHomePhabricator

D11940.id28762.diff
No OneTemporary

D11940.id28762.diff

diff --git a/src/aphront/response/AphrontFileResponse.php b/src/aphront/response/AphrontFileResponse.php
--- a/src/aphront/response/AphrontFileResponse.php
+++ b/src/aphront/response/AphrontFileResponse.php
@@ -15,9 +15,8 @@
}
public function setDownload($download) {
- $download = preg_replace('/[^A-Za-z0-9_.-]/', '_', $download);
if (!strlen($download)) {
- $download = 'untitled_document.txt';
+ $download = 'untitled';
}
$this->download = $download;
return $this;
@@ -73,9 +72,10 @@
$headers[] = array('X-Download-Options', 'noopen');
$filename = $this->getDownload();
+ $filename = addcslashes($filename, '"\\');
$headers[] = array(
'Content-Disposition',
- 'attachment; filename='.$filename,
+ 'attachment; filename="'.$filename.'"',
);
}

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 23, 11:45 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6745450
Default Alt Text
D11940.id28762.diff (853 B)

Event Timeline