mirror of
https://github.com/danog/tgseclib.git
synced 2024-11-27 12:44:38 +01:00
Merge pull request #719 from terrafrost/lstat-fix-1.0
SFTP: update conditions under which cache for lstat / . is used for 1.0 branch * terrafrost/lstat-fix-1.0: Tests/SFTP: $lstat->$stat Tests/SFTP: just check to see that stat / lstat return an array SFTP: update conditions under which cache for lstat / . is used Tests/SFTP: add test for stat's on .
This commit is contained in:
commit
1ad66ad1ea
@ -1214,7 +1214,7 @@ class Net_SFTP extends Net_SSH2
|
|||||||
|
|
||||||
if ($this->use_stat_cache) {
|
if ($this->use_stat_cache) {
|
||||||
$result = $this->_query_stat_cache($filename);
|
$result = $this->_query_stat_cache($filename);
|
||||||
if (is_array($result) && isset($result['.'])) {
|
if (is_array($result) && isset($result['.']) && isset($result['.']->lstat)) {
|
||||||
return $result['.']->lstat;
|
return $result['.']->lstat;
|
||||||
}
|
}
|
||||||
if (is_object($result) && isset($result->lstat)) {
|
if (is_object($result) && isset($result->lstat)) {
|
||||||
|
@ -427,8 +427,28 @@ class Functional_Net_SFTPUserStoryTest extends PhpseclibFunctionalTestCase
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* on older versions this would result in a fatal error
|
|
||||||
* @depends testReadlink
|
* @depends testReadlink
|
||||||
|
* @group github716
|
||||||
|
*/
|
||||||
|
public function testStatOnCWD($sftp)
|
||||||
|
{
|
||||||
|
$stat = $sftp->stat('.');
|
||||||
|
$this->assertInternalType(
|
||||||
|
'array', $stat,
|
||||||
|
'Failed asserting that stat on . returns an array'
|
||||||
|
);
|
||||||
|
$lstat = $sftp->lstat('.');
|
||||||
|
$this->assertInternalType(
|
||||||
|
'array', $lstat,
|
||||||
|
'Failed asserting that lstat on . returns an array'
|
||||||
|
);
|
||||||
|
|
||||||
|
return $sftp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* on older versions this would result in a fatal error
|
||||||
|
* @depends testStatOnCWD
|
||||||
* @group github402
|
* @group github402
|
||||||
*/
|
*/
|
||||||
public function testStatcacheFix($sftp)
|
public function testStatcacheFix($sftp)
|
||||||
|
Loading…
Reference in New Issue
Block a user