Repository navigation
[rc-1.6.0] FOGSSH: null the link on disconnect, and close only a live session - #1999
Merged
Merged
Conversation
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, andglobal-class-prefixpass on this branch. Both phpstan passes are clean.🤖 Generated with Claude Code