Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
999 B · 39 lines
PHP
12345678910111213141516171819202122232425262728293031323334353637383940<?php
final class PhabricatorSystemObjectController extends PhabricatorController {
public function shouldAllowPublic() { return true; }
public function handleRequest(AphrontRequest $request) { $viewer = $this->getViewer(); $name = $request->getURIData('name');
$object = id(new PhabricatorObjectQuery()) ->setViewer($viewer) ->withNames(array($name)) ->executeOne(); if (!$object) { return new Aphront404Response(); }
$phid = $object->getPHID(); $handles = $viewer->loadHandles(array($phid)); $handle = $handles[$phid];
$object_uri = $handle->getURI(); if (!strlen($object_uri)) { return $this->newDialog() ->setTitle(pht('No Object URI')) ->appendParagraph( pht( 'Object "%s" exists, but does not have a URI to redirect to.', $name)) ->addCancelButton('/', pht('Done')); }
return id(new AphrontRedirectResponse())->setURI($object_uri); }}