Skip to content

Commit

Permalink
Homepage|Build Repository|Fixed: Events not covered by the repository…
Browse files Browse the repository at this point in the history
… should redirect to the index
  • Loading branch information
danij-deng committed Mar 31, 2012
1 parent 8812f9f commit cdd972c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions web/plugins/buildrepository/buildrepository.php
Expand Up @@ -779,8 +779,14 @@ public function InterpretRequest($request)
{
$this->initPackages();

$buildNumber = intval(substr($tokens[0], 5));
$FrontController->enqueueAction($this, array('build' => $buildNumber));
$buildId = intval(substr($tokens[0], 5));

// Is this a known event?
$build = $this->buildByUniqueId($buildId);
if(!$build instanceof BuildEvent)
$buildId = 0; // Show the index.

$FrontController->enqueueAction($this, array('build' => $buildId));
return true; // Eat the request.
}

Expand Down Expand Up @@ -819,15 +825,12 @@ private function outputBuildStreamNavigation(&$event)
public function buildByUniqueId($uniqueId=0)
{
$uniqueId = intval($uniqueId);
$build = NULL;
if($uniqueId > 0)
foreach($this->builds as &$build)
{
foreach($this->builds as &$build)
{
if($uniqueId === $build->uniqueId()) break;
}
if($uniqueId === $build->uniqueId()) return $build;
}
return $build;
return NULL;
}

private function outputEventList($maxEvents=10)
Expand Down

0 comments on commit cdd972c

Please sign in to comment.