stat() and lstat() ignore false output from _stat()

Thanks Fluffycloud!
This commit is contained in:
terrafrost 2012-09-16 18:50:16 -05:00
parent 31ad9aacbd
commit c7d6492f43
1 changed files with 7 additions and 1 deletions

View File

@ -886,6 +886,9 @@ class Net_SFTP extends Net_SSH2 {
}
$stat = $this->_stat($filename, NET_SFTP_STAT);
if ($stat === false) {
return false;
}
$pwd = $this->pwd;
$stat['type'] = $this->chdir($filename) ?
@ -918,6 +921,9 @@ class Net_SFTP extends Net_SSH2 {
$lstat = $this->_stat($filename, NET_SFTP_LSTAT);
$stat = $this->_stat($filename, NET_SFTP_STAT);
if ($stat === false) {
return false;
}
if ($lstat != $stat) {
return array_merge($lstat, array('type' => NET_SFTP_TYPE_SYMLINK));
@ -1958,4 +1964,4 @@ class Net_SFTP extends Net_SSH2 {
$this->pwd = false;
parent::_disconnect($reason);
}
}
}