mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
Fix empty string handling for custom_port to match defensive pattern
The null coalescing operator (??) only checks for null, not empty strings. When custom_port is an empty string, it would pass through and cause SSH connections to fail with an invalid port. This commit updates line 3053 to match the same defensive pattern used at lines 3039-3041, checking for null, empty strings, and casting to int for consistent validation across both code paths. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
174a766ae6
commit
8abbf284a5
1 changed files with 1 additions and 1 deletions
|
|
@ -3050,7 +3050,7 @@ function convertGitUrl(string $gitRepository, string $deploymentType, GithubApp|
|
|||
case \App\Models\GithubApp::class:
|
||||
case \App\Models\GitlabApp::class:
|
||||
$providerInfo['host'] = Url::fromString($source->html_url)->getHost();
|
||||
$providerInfo['port'] = $source->custom_port ?? 22;
|
||||
$providerInfo['port'] = ($source->custom_port !== null && $source->custom_port !== '' && (int) $source->custom_port !== 22) ? (int) $source->custom_port : 22;
|
||||
$providerInfo['user'] = $source->custom_user;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue