Skip to content

Commit a761e53

Browse files
michielkallemoay
authored andcommitted
Fix regex for GitLab URL's (#45)
1 parent 0d4bb40 commit a761e53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Service/RecipePublicUrlResolver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private function resolveHttpUrl(string $repoUrl, string $packageName)
7373
*/
7474
private function resolveSshUrl(string $repoUrl, string $packageName)
7575
{
76-
if (preg_match('/^(?:ssh(?::\/\/)?)?(?:git)?@?([a-zA-Z0-9-_\.]+\.[a-z]+)(:[0-9])?(?:[:\/]([a-zA-Z0-9-_\.]*))?\/([a-zA-Z0-9-_\.]+)\/([a-zA-Z0-9-_]+)(?:.git)?$/', $repoUrl, $urlParts)) {
76+
if (preg_match('/^(?:ssh(?::\/\/)?)?(?:git)?@?([a-zA-Z0-9-_\.]+\.[a-z]+)(:[0-9])?(?:[:\/]([a-zA-Z0-9-_\.]*))?(\/|:)([a-zA-Z0-9-_\.]+)\/([a-zA-Z0-9-_]+)(?:.git)?$/', $repoUrl, $urlParts)) {
7777
$host = $urlParts[1];
7878
$port = empty($urlParts[2]) ? null : $urlParts[2];
7979
$prefix = empty($urlParts[3]) ? null : $urlParts[3];

0 commit comments

Comments
 (0)