Skip to content

Commit

Permalink
.- ProjectController::build: now also checks GET-vars for chosen bran…
Browse files Browse the repository at this point in the history
…ch name

.- Project/view: changed link on "build now": when a different branch is chosen, then send it through GET-vars, so slashes are not a problem
  • Loading branch information
Paul Staring authored and Dan Cryer committed Sep 6, 2017
1 parent 9403b5d commit cdccd5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions PHPCI/Controller/ProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ public function build($projectId, $branch = '')
/* @var \PHPCI\Model\Project $project */
$project = $this->projectStore->getById($projectId);

if ($branch === '' && filter_input(INPUT_GET, 'branch') !== null) {
$branch = filter_input(INPUT_GET, 'branch');
}

if (empty($branch)) {
$branch = $project->getBranch();
}
Expand Down
2 changes: 1 addition & 1 deletion PHPCI/View/Project/view.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</a>

<div class="pull-right btn-group">
<a class="btn btn-success" href="<?php print PHPCI_URL . 'project/build/' . $project->getId(); ?><?php echo !empty($branch) ? '/' . urlencode($branch) : '' ?>">
<a class="btn btn-success" href="<?php print PHPCI_URL . 'project/build/' . $project->getId(); ?><?php echo !empty($branch) ? '?branch=' . urlencode($branch) : '' ?>">
<?php Lang::out('build_now'); ?>
</a>

Expand Down

0 comments on commit cdccd5d

Please sign in to comment.