Differential D8516 Diff 20210 src/applications/diffusion/controller/DiffusionRepositoryCreateController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionRepositoryCreateController.php
Show First 20 Lines • Show All 359 Lines • ▼ Show 20 Lines | public function validateNamePage(PHUIFormPageView $page) { | ||||
} | } | ||||
$c_call = $page->getControl('callsign'); | $c_call = $page->getControl('callsign'); | ||||
$v_call = $c_call->getValue(); | $v_call = $c_call->getValue(); | ||||
if (!strlen($v_call)) { | if (!strlen($v_call)) { | ||||
$c_call->setError(pht('Required')); | $c_call->setError(pht('Required')); | ||||
$page->addPageError( | $page->addPageError( | ||||
pht('You must choose a callsign for this repository.')); | pht('You must choose a callsign for this repository.')); | ||||
} else if (!preg_match('/^[A-Z]+$/', $v_call)) { | } else if (!preg_match('/^[A-Z]+\z/', $v_call)) { | ||||
$c_call->setError(pht('Invalid')); | $c_call->setError(pht('Invalid')); | ||||
$page->addPageError( | $page->addPageError( | ||||
pht('The callsign must contain only UPPERCASE letters.')); | pht('The callsign must contain only UPPERCASE letters.')); | ||||
} else { | } else { | ||||
$exists = false; | $exists = false; | ||||
try { | try { | ||||
$repo = id(new PhabricatorRepositoryQuery()) | $repo = id(new PhabricatorRepositoryQuery()) | ||||
->setViewer($this->getRequest()->getUser()) | ->setViewer($this->getRequest()->getUser()) | ||||
▲ Show 20 Lines • Show All 544 Lines • Show Last 20 Lines |