fix(application): do not crash on commit links for git:// repositories

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andras Bacsai
2026-09-27 21:09:13 +02:00
co-authored by Claude Opus 5.5
parent 862e021f2d
commit 0a144a5d7a
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -743,7 +743,7 @@ class Application extends BaseModel
$git_repository = 'https://'.parse_url($git_repository, PHP_URL_HOST).parse_url($git_repository, PHP_URL_PATH);
}
if (! filter_var($git_repository, FILTER_VALIDATE_URL)) {
if (! filter_var($git_repository, FILTER_VALIDATE_URL) || ! in_array(parse_url($git_repository, PHP_URL_SCHEME), ['http', 'https'], true)) {
return null;
}
@@ -44,6 +44,7 @@ it('does not generate commit links from incomplete repository URLs', function (s
})->with([
'missing host' => 'https://',
'missing scheme' => 'github.com/coollabsio/coolify',
'git protocol' => 'git://git.example.com/coollabsio/coolify.git',
]);
it('converts scp-style remotes with generic usernames into https repository links', function (string $repository, string $expectedBranch, string $expectedCommits, string $expectedWebhook) {