Skip to content

fix(sftp): Handle empty port parameter to allow host-defined ports#58350

Open
solracsf wants to merge 1 commit intomasterfrom
regressionEmptyPort
Open

fix(sftp): Handle empty port parameter to allow host-defined ports#58350
solracsf wants to merge 1 commit intomasterfrom
regressionEmptyPort

Conversation

@solracsf
Copy link
Member

@solracsf solracsf commented Feb 14, 2026

Fix #58324
Fix #58293

Summary

Regression from #57793

When a host string includes a port (e.g., 1.2.3.4:22), it was being ignored if $parameters['port'] was present but empty (e.g., ''). The previous logic $parameters['port'] ?? $parsedHost[1] treated an empty string as a valid value, overriding the port correctly parsed from the host.

This fix ensures $parameters['port'] is only prioritized if it contains a valid numeric value. Empty strings, nulls, or non-numeric values now correctly fall back to the port defined in the host string.

Checklist

@solracsf solracsf added this to the Nextcloud 34 milestone Feb 14, 2026
@solracsf solracsf requested a review from a team as a code owner February 14, 2026 11:13
@solracsf solracsf requested review from ArtificialOwl, CarlSchwan, come-nc and icewind1991 and removed request for a team February 14, 2026 11:13
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
@solracsf solracsf force-pushed the regressionEmptyPort branch from 3750b3f to b1e71ae Compare February 14, 2026 11:29
@solracsf
Copy link
Member Author

/backport to stable33

@solracsf
Copy link
Member Author

/backport to stable32

@solracsf
Copy link
Member Author

/backport to stable31

@tgeller
Copy link

tgeller commented Feb 14, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants