Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionController.php
Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | abstract class DiffusionController extends PhabricatorController { | ||||
protected function getDiffusionBlobFromRequest(AphrontRequest $request) { | protected function getDiffusionBlobFromRequest(AphrontRequest $request) { | ||||
return $request->getURIData('dblob'); | return $request->getURIData('dblob'); | ||||
} | } | ||||
protected function getRepositoryIdentifierFromRequest( | protected function getRepositoryIdentifierFromRequest( | ||||
AphrontRequest $request) { | AphrontRequest $request) { | ||||
$short_name = $request->getURIData('repositoryShortName'); | $short_name = $request->getURIData('repositoryShortName'); | ||||
if (strlen($short_name)) { | if (phutil_nonempty_string($short_name)) { | ||||
// If the short name ends in ".git", ignore it. | // If the short name ends in ".git", ignore it. | ||||
$short_name = preg_replace('/\\.git\z/', '', $short_name); | $short_name = preg_replace('/\\.git\z/', '', $short_name); | ||||
return $short_name; | return $short_name; | ||||
} | } | ||||
$identifier = $request->getURIData('repositoryCallsign'); | $identifier = $request->getURIData('repositoryCallsign'); | ||||
if (strlen($identifier)) { | if (phutil_nonempty_string($identifier)) { | ||||
return $identifier; | return $identifier; | ||||
} | } | ||||
$id = $request->getURIData('repositoryID'); | $id = $request->getURIData('repositoryID'); | ||||
if (strlen($id)) { | if (phutil_nonempty_string($id)) { | ||||
return (int)$id; | return (int)$id; | ||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
public function buildCrumbs(array $spec = array()) { | public function buildCrumbs(array $spec = array()) { | ||||
$crumbs = $this->buildApplicationCrumbs(); | $crumbs = $this->buildApplicationCrumbs(); | ||||
▲ Show 20 Lines • Show All 437 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0