From 79719e8f74b653f85233d2b4585fd79186e7df96 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 8 Apr 2014 08:48:12 -0500 Subject: [PATCH] SSH2: move _connect() call to _login() from login() Per bantu, this is required for it to work with Net/SFTP.php --- phpseclib/Net/SSH2.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 22f8fe6f..3dee6eac 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1760,13 +1760,6 @@ class Net_SSH2 */ function login($username) { - if (!($this->bitmap & NET_SSH2_MASK_CONSTRUCTOR)) { - $this->bitmap |= NET_SSH2_MASK_CONSTRUCTOR; - if (!$this->_connect()) { - return false; - } - } - $args = func_get_args(); return call_user_func_array(array(&$this, '_login'), $args); } @@ -1783,6 +1776,13 @@ class Net_SSH2 */ function _login($username) { + if (!($this->bitmap & NET_SSH2_MASK_CONSTRUCTOR)) { + $this->bitmap |= NET_SSH2_MASK_CONSTRUCTOR; + if (!$this->_connect()) { + return false; + } + } + $args = array_slice(func_get_args(), 1); if (empty($args)) { return $this->_login_helper($username);