Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13993569
D11940.id28762.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
853 B
Referenced Files
None
Subscribers
None
D11940.id28762.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D11940: Stop mangling filenames when downloading them
Attached
Detach File
Event Timeline
Log In to Comment