Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2694822
D25478.1734805486.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25478.1734805486.diff
View Options
diff --git a/src/applications/differential/controller/DifferentialRevisionViewController.php b/src/applications/differential/controller/DifferentialRevisionViewController.php
--- a/src/applications/differential/controller/DifferentialRevisionViewController.php
+++ b/src/applications/differential/controller/DifferentialRevisionViewController.php
@@ -1090,20 +1090,13 @@
$request_uri = $this->getRequest()->getRequestURI();
- // this ends up being something like
- // D123.diff
- // or the verbose
- // D123.vs123.id123.highlightjs.diff
- // lame but nice to include these options
- $file_name = ltrim($request_uri->getPath(), '/').'.';
- foreach ($request_uri->getQueryParamsAsPairList() as $pair) {
- list($key, $value) = $pair;
- if ($key == 'download') {
- continue;
- }
- $file_name .= $key.$value.'.';
- }
- $file_name .= 'diff';
+ // Filename ends up being something like D123.1692295858.diff
+ // This discards some options in the query string that may affect the diff
+ // response, but is intentional to avoid spammy titles from bot requests.
+ $timestamp =
+ PhabricatorTime::getNow() +
+ phutil_units('24 hours in seconds');
+ $file_name = ltrim($request_uri->getPath(), '/').'.'.$timestamp.'.diff';
$iterator = new ArrayIterator(array($raw_diff));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 18:24 (16 h, 7 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1021127
Default Alt Text
D25478.1734805486.diff (1 KB)
Attached To
Mode
D25478: Use predictable filenames when downloading raw diffs from a revision
Attached
Detach File
Event Timeline
Log In to Comment