Skip to content

[rc-1.6.0] FOGSSH: null the link on disconnect, and close only a live session - #1999

Merged
mastacontrola merged 1 commit into
rc-1.6.0from
fix/fogssh-reconnect-after-disconnect-rc
Oct 28, 2026
Merged

mastacontrola merged 1 commit into
rc-1.6.0from
fix/fogssh-reconnect-after-disconnect-rc

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Port of #1998 to rc-1.6.0. Fixes #1997 for the next RC.

The cherry-pick applied cleanly. fogssh-reuse-after-disconnect, fogssh-size, and global-class-prefix pass on this branch. Both phpstan passes are clean.

🤖 Generated with Claude Code

disconnect() unset() the declared $_link and $_sftp. PHP routes the next
read of an unset declared property to __get(), which looks it up in $data,
so every reuse of the shared instance warned 'Undefined array key "_link"'
at FOGSSH.php:133. Set them to null instead.

disconnect() also handed a false or null link to ssh2_disconnect(). On PHP 8
that is a TypeError, which @ does not suppress, so disconnect() after a
failed connect() or a second disconnect() was fatal. Close only a resource.

tests/fogssh-reuse-after-disconnect.test.php drives disconnect() twice on
the real class. Each check fails on its own defect: the TypeError on the
base, and the warning with only the unset() put back.

Fixes #1997

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 51229fe)
@mastacontrola
mastacontrola merged commit 90caf5c into rc-1.6.0 Oct 28, 2026
11 checks passed
@mastacontrola
mastacontrola deleted the fix/fogssh-reconnect-after-disconnect-rc branch October 28, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant