From 8abbf284a5758a550581a17d1536a2bad71514da Mon Sep 17 00:00:00 2001 From: Claude Code Date: Sun, 2 Nov 2025 20:17:21 +0000 Subject: [PATCH] Fix empty string handling for custom_port to match defensive pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- bootstrap/helpers/shared.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap/helpers/shared.php b/bootstrap/helpers/shared.php index a41482b02..3edd66cdc 100644 --- a/bootstrap/helpers/shared.php +++ b/bootstrap/helpers/shared.php @@ -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; }