This commit is contained in:
terrafrost 2013-04-02 19:37:36 -05:00
commit 1c7fb5bd67
3 changed files with 9 additions and 4 deletions

View File

@ -918,6 +918,9 @@ class File_ASN1 {
} }
$value = new Math_BigInteger($value); $value = new Math_BigInteger($value);
$value = $value->toBytes(true); $value = $value->toBytes(true);
if (!strlen($value)) {
$value = chr(0);
}
} }
break; break;
case FILE_ASN1_TYPE_UTC_TIME: case FILE_ASN1_TYPE_UTC_TIME:

View File

@ -1648,6 +1648,7 @@ class Net_SFTP extends Net_SSH2 {
} }
break; break;
case NET_SFTP_STATUS: case NET_SFTP_STATUS:
// could, in theory, return false if !strlen($content) but we'll hold off for the time being
$this->_logError($response); $this->_logError($response);
break 2; break 2;
default: default:
@ -1691,6 +1692,7 @@ class Net_SFTP extends Net_SSH2 {
return false; return false;
} }
// if $content isn't set that means a file was written to
if (isset($content)) { if (isset($content)) {
return $content; return $content;
} }

View File

@ -37,8 +37,8 @@
/** /**
* Include Net_SSH2 * Include Net_SSH2
*/ */
if (!class_exists('Net_SSH2')) { if (!class_exists('Net_SFTP')) {
require_once('../Net/SSH2.php'); require_once('Net/SFTP.php');
} }
/** /**
@ -256,7 +256,7 @@ class Net_SFTP_Stream {
//} //}
$result = $this->sftp->get($this->path, false, $this->pos, $count); $result = $this->sftp->get($this->path, false, $this->pos, $count);
if ($result === false) { if (empty($result)) {
$this->eof = true; $this->eof = true;
return false; return false;
} }