Page MenuHomePhorge

D25478.1731961025.diff
No OneTemporary

D25478.1731961025.diff

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

Mime Type
text/plain
Expires
Mon, Nov 18, 20:17 (36 m, 40 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
976914
Default Alt Text
D25478.1731961025.diff (1 KB)

Event Timeline