1
0
Fork 0

Merge branch 'master' into 2.0

pull/6942/head^2
Jordi Boggiano 2019-07-31 18:12:00 +02:00
commit 0a152b06d7
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 8 additions and 1 deletions

View File

@ -498,13 +498,20 @@ class GitLabDriver extends VcsDriver
private static function determineOrigin(array $configuredDomains, $guessedDomain, array &$urlParts, $portNumber) private static function determineOrigin(array $configuredDomains, $guessedDomain, array &$urlParts, $portNumber)
{ {
if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array($guessedDomain.':'.$portNumber, $configuredDomains))) { if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array($guessedDomain.':'.$portNumber, $configuredDomains))) {
if ($portNumber) {
return $guessedDomain.':'.$portNumber;
}
return $guessedDomain; return $guessedDomain;
} }
if ($portNumber) {
$guessedDomain .= ':'.$portNumber;
}
while (null !== ($part = array_shift($urlParts))) { while (null !== ($part = array_shift($urlParts))) {
$guessedDomain .= '/' . $part; $guessedDomain .= '/' . $part;
if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array(preg_replace('{/}', ':'.$portNumber.'/', $guessedDomain, 1), $configuredDomains))) { if (in_array($guessedDomain, $configuredDomains) || ($portNumber && in_array(preg_replace('{:\d+}', '', $guessedDomain), $configuredDomains))) {
return $guessedDomain; return $guessedDomain;
} }
} }