Skip to content

Commit

Permalink
SFTP: make it so extending SFTP class doesn't cause a segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed Apr 4, 2020
1 parent 41eb0d8 commit c301ddf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion phpseclib/Net/SFTP.php
Expand Up @@ -467,7 +467,11 @@ function Net_SFTP($host, $port = 22, $timeout = 10)
*/
function login($username)
{
if (!call_user_func_array(array(&$this, 'parent::login'), func_get_args())) {
$args = func_get_args();
$callback = version_compare(PHP_VERSION, '5.3.0') < 0 ?
array(&$this, 'parent::login') :
'parent::login';
if (!call_user_func_array($callback, $args)) {
return false;
}

Expand Down

1 comment on commit c301ddf

@terrafrost
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1465

Please sign in to comment.