Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/controller/PhabricatorFileDataController.php
Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | private function loadFile() { | ||||
// sure we're consitent about returning HTTP 404 on bad requests instead | // sure we're consitent about returning HTTP 404 on bad requests instead | ||||
// of serving HTTP 200 with a login page, which can mislead some clients. | // of serving HTTP 200 with a login page, which can mislead some clients. | ||||
$viewer = PhabricatorUser::getOmnipotentUser(); | $viewer = PhabricatorUser::getOmnipotentUser(); | ||||
$file = id(new PhabricatorFileQuery()) | $file = id(new PhabricatorFileQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->withPHIDs(array($this->phid)) | ->withPHIDs(array($this->phid)) | ||||
->withIsDeleted(false) | |||||
->executeOne(); | ->executeOne(); | ||||
if (!$file) { | if (!$file) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
// We may be on the CDN domain, so we need to use a fully-qualified URI | // 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. | // here to make sure we end up back on the main domain. | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |