diff --git a/PHPCI/Controller/ProjectController.php b/PHPCI/Controller/ProjectController.php index 7c336eca..95f8c2cd 100644 --- a/PHPCI/Controller/ProjectController.php +++ b/PHPCI/Controller/ProjectController.php @@ -189,11 +189,21 @@ class ProjectController extends \PHPCI\Controller if ($values['type'] == "gitlab") { preg_match('`^(.*)@(.*):(.*)/(.*)\.git`', $values['reference'], $matches); + $info = array(); - $info["user"] = $matches[1]; - $info["domain"] = $matches[2]; + if (isset($matches[1])) { + $info["user"] = $matches[1]; + } + + if (isset($matches[2])) { + $info["domain"] = $matches[2]; + } + $values['access_information'] = serialize($info); - $values['reference'] = $matches[3]."/".$matches[4]; + + if (isset($matches[3]) && isset($matches[4])) { + $values['reference'] = $matches[3]."/".$matches[4]; + } } $values['git_key'] = $values['key'];