Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14022996
D15650.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D15650.diff
View Options
diff --git a/src/applications/files/controller/PhabricatorFileDataController.php b/src/applications/files/controller/PhabricatorFileDataController.php
--- a/src/applications/files/controller/PhabricatorFileDataController.php
+++ b/src/applications/files/controller/PhabricatorFileDataController.php
@@ -119,22 +119,46 @@
return new Aphront404Response();
}
+ // We may be on the CDN domain, so we need to use a fully-qualified URI
+ // here to make sure we end up back on the main domain.
+ $info_uri = PhabricatorEnv::getURI($file->getInfoURI());
+
+
if (!$file->validateSecretKey($this->key)) {
- return new Aphront403Response();
+ $dialog = $this->newDialog()
+ ->setTitle(pht('Invalid Authorization'))
+ ->appendParagraph(
+ pht(
+ 'The link you followed to access this file is no longer '.
+ 'valid. The visibility of the file may have changed after '.
+ 'the link was generated.'))
+ ->appendParagraph(
+ pht(
+ 'You can continue to the file detail page to get more '.
+ 'information and attempt to access the file.'))
+ ->addCancelButton($info_uri, pht('Continue'));
+
+ return id(new AphrontDialogResponse())
+ ->setDialog($dialog)
+ ->setHTTPResponseCode(404);
}
if ($file->getIsPartial()) {
- // We may be on the CDN domain, so we need to use a fully-qualified URI
- // here to make sure we end up back on the main domain.
- $info_uri = PhabricatorEnv::getURI($file->getInfoURI());
-
- return $this->newDialog()
+ $dialog = $this->newDialog()
->setTitle(pht('Partial Upload'))
->appendParagraph(
pht(
'This file has only been partially uploaded. It must be '.
'uploaded completely before you can download it.'))
- ->addCancelButton($info_uri);
+ ->appendParagraph(
+ pht(
+ 'You can continue to the file detail page to monitor the '.
+ 'upload progress of the file.'))
+ ->addCancelButton($info_uri, pht('Continue'));
+
+ return id(new AphrontDialogResponse())
+ ->setDialog($dialog)
+ ->setHTTPResponseCode(404);
}
$this->file = $file;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 9:43 PM (1 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6717776
Default Alt Text
D15650.diff (2 KB)
Attached To
Mode
D15650: Don't dead-end users with out-of-date links to files
Attached
Detach File
Event Timeline
Log In to Comment