1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-11-27 04:46:26 +01:00

- fix E_NOTICEs (thanks, lordxor!)

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@155 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
Jim Wigginton 2011-05-08 02:31:52 +00:00
parent e42adbeaf9
commit bfacdf5cdf

View File

@ -214,6 +214,15 @@ class Net_SFTP extends Net_SSH2 {
*/
var $sftp_errors = array();
/**
* File Type
*
* @see Net_SFTP::_parseLongname()
* @var Integer
* @access private
*/
var $fileType = 0;
/**
* Default Constructor.
*
@ -510,8 +519,8 @@ class Net_SFTP extends Net_SSH2 {
// the following is SFTPv3 only code. see Net_SFTP::_parseLongname() for more information.
// per the above comment, this is a shot in the dark that, on most servers, won't help us in determining
// the file type for Net_SFTP::stat() and Net_SFTP::lstat() but it's worth a shot.
//extract(unpack('Nlength', $this->_string_shift($response, 4)));
//$this->fileType = $this->_parseLongname($this->_string_shift($response, $length));
extract(unpack('Nlength', $this->_string_shift($response, 4)));
$this->fileType = $this->_parseLongname($this->_string_shift($response, $length));
break;
case NET_SFTP_STATUS:
extract(unpack('Nstatus/Nlength', $this->_string_shift($response, 8)));
@ -1233,6 +1242,9 @@ class Net_SFTP extends Net_SSH2 {
return false;
}
extract(unpack('Nstatus/Nlength', $this->_string_shift($response, 8)));
$this->sftp_errors[] = $this->status_codes[$status] . ': ' . $this->_string_shift($response, $length);
// check the status from the NET_SFTP_STATUS case in the above switch after the file has been closed
if ($status != NET_SFTP_STATUS_OK) {
return false;