1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-11-30 04:39:21 +01:00

Merge pull request #494 from bantu/sftp-filesize-hexdec

SFTP: Use hexdec() and bin2hex() for filesize calculation.

* bantu/sftp-filesize-hexdec:
  SFTP: Use hexdec() and bin2hex() for filesize calculation.
This commit is contained in:
Andreas Fischer 2014-10-19 21:32:18 +02:00
commit e63fe3fbdf

View File

@ -2479,9 +2479,7 @@ class Net_SFTP extends Net_SSH2
// IEEE 754 binary64 "double precision" on such platforms and
// as such can represent integers of at least 2^50 without loss
// of precision. Interpreted in filesize, 2^50 bytes = 1024 TiB.
extract(unpack('Nupper/Nsize', $this->_string_shift($response, 8)));
$attr['size'] = $upper ? 4294967296 * $upper : 0;
$attr['size']+= $size < 0 ? ($size & 0x7FFFFFFF) + 0x80000000 : $size;
$attr['size'] = hexdec(bin2hex($this->_string_shift($response, 8)));
break;
case NET_SFTP_ATTR_UIDGID: // 0x00000002 (SFTPv3 only)
$attr+= unpack('Nuid/Ngid', $this->_string_shift($response, 8));