Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionCommitController.php
Show All 21 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$drequest = $this->getDiffusionRequest(); | $drequest = $this->getDiffusionRequest(); | ||||
$viewer = $request->getUser(); | $viewer = $request->getUser(); | ||||
$repository = $drequest->getRepository(); | $repository = $drequest->getRepository(); | ||||
$commit_identifier = $drequest->getCommit(); | $commit_identifier = $drequest->getCommit(); | ||||
// If this page is being accessed via "/source/xyz/commit/...", redirect | // If this page is being accessed via "/source/xyz/commit/...", redirect | ||||
// to the canonical URI. | // to the canonical URI. | ||||
$has_callsign = strlen($request->getURIData('repositoryCallsign')); | $repo_callsign = $request->getURIData('repositoryCallsign'); | ||||
$has_id = strlen($request->getURIData('repositoryID')); | $has_callsign = $repo_callsign !== null && strlen($repo_callsign); | ||||
$repo_id = $request->getURIData('repositoryID'); | |||||
$has_id = $repo_id !== null && strlen($repo_id); | |||||
if (!$has_callsign && !$has_id) { | if (!$has_callsign && !$has_id) { | ||||
$canonical_uri = $repository->getCommitURI($commit_identifier); | $canonical_uri = $repository->getCommitURI($commit_identifier); | ||||
return id(new AphrontRedirectResponse()) | return id(new AphrontRedirectResponse()) | ||||
->setURI($canonical_uri); | ->setURI($canonical_uri); | ||||
} | } | ||||
if ($request->getStr('diff')) { | if ($request->getStr('diff')) { | ||||
return $this->buildRawDiffResponse($drequest); | return $this->buildRawDiffResponse($drequest); | ||||
▲ Show 20 Lines • Show All 877 Lines • ▼ Show 20 Lines | foreach ($audit_requests as $request) { | ||||
$view->addItem($item); | $view->addItem($item); | ||||
} | } | ||||
return $view; | return $view; | ||||
} | } | ||||
private function linkBugtraq($corpus) { | private function linkBugtraq($corpus) { | ||||
$url = PhabricatorEnv::getEnvConfig('bugtraq.url'); | $url = PhabricatorEnv::getEnvConfig('bugtraq.url'); | ||||
if (!strlen($url)) { | if ($url === null || !strlen($url)) { | ||||
return $corpus; | return $corpus; | ||||
} | } | ||||
$regexes = PhabricatorEnv::getEnvConfig('bugtraq.logregex'); | $regexes = PhabricatorEnv::getEnvConfig('bugtraq.logregex'); | ||||
if (!$regexes) { | if (!$regexes) { | ||||
return $corpus; | return $corpus; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 236 Lines • Show Last 20 Lines |