Diffusion - return 404 errors for bad URIs
Summary: Fixes T5646. Makes diffusion a much better user experience. Users now see a 404 exception page when they have a bad URI. Previously, they saw a developer-facing raw exception. Test Plan: played around in diffusion a bunch. most of these changes were fairly mechanical at the end of the day. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T5646 Differential Revision: https://secure.phabricator.com/D11299
This commit is contained in:
@@ -3,15 +3,7 @@
|
||||
final class DiffusionMirrorEditController
|
||||
extends DiffusionController {
|
||||
|
||||
private $id;
|
||||
|
||||
public function willProcessRequest(array $data) {
|
||||
$this->id = idx($data, 'id');
|
||||
parent::willProcessRequest($data);
|
||||
}
|
||||
|
||||
public function processRequest() {
|
||||
$request = $this->getRequest();
|
||||
protected function processDiffusionRequest(AphrontRequest $request) {
|
||||
$viewer = $request->getUser();
|
||||
$drequest = $this->diffusionRequest;
|
||||
$repository = $drequest->getRepository();
|
||||
@@ -21,10 +13,10 @@ final class DiffusionMirrorEditController
|
||||
$repository,
|
||||
PhabricatorPolicyCapability::CAN_EDIT);
|
||||
|
||||
if ($this->id) {
|
||||
if ($request->getURIData('id')) {
|
||||
$mirror = id(new PhabricatorRepositoryMirrorQuery())
|
||||
->setViewer($viewer)
|
||||
->withIDs(array($this->id))
|
||||
->withIDs(array($request->getURIData('id')))
|
||||
->requireCapabilities(
|
||||
array(
|
||||
PhabricatorPolicyCapability::CAN_VIEW,
|
||||
|
||||
Reference in New Issue
Block a user