Merge branch '3.0'

This commit is contained in:
terrafrost 2023-08-28 08:51:17 -05:00
commit c160a020db
2 changed files with 13 additions and 8 deletions

View File

@ -2191,14 +2191,6 @@ class SFTP extends SSH2
}
}
if ($length > 0 && $length <= $offset - $start) {
if ($local_file === false) {
$content = substr($content, 0, $length);
} else {
ftruncate($fp, $length + $res_offset);
}
}
if ($fclose_check) {
fclose($fp);

View File

@ -802,5 +802,18 @@ class SFTPUserStoryTest extends PhpseclibFunctionalTestCase
$stat2 = $sftp->stat(self::$scratchDir);
$this->assertSame($stat['uid'], $stat2['uid']);
$this->assertSame($stat['gid'], $stat2['gid']);
return $sftp;
}
/**
* @depends testChownChgrp
* @group github1934
*/
public function testCallableGetWithLength($sftp)
{
$sftp->put('test.txt', 'zzzzz');
$sftp->get('test.txt', function($data) {}, 0, 1);
$this->assertTrue(true);
}
}