- suppress errors about empty strings being passed to crypto object

- fix a bug in read() that broke NET_SSH2_READ_REGEX

git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@156 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
Jim Wigginton 2011-05-08 02:34:36 +00:00
parent bfacdf5cdf
commit c6bc908f63

View File

@ -601,7 +601,7 @@ class Net_SSH2 {
* @var Array
* @access private
*/
var $interactive_buffer = '';
var $interactiveBuffer = '';
/**
* Default Constructor.
@ -1777,14 +1777,15 @@ class Net_SSH2 {
return false;
}
$match = $expect;
while (true) {
if ($mode == NET_SSH2_READ_REGEX) {
preg_match($expect, $this->interactiveBuffer, $matches);
$expect = $matches[0];
$match = $matches[0];
}
$pos = strpos($this->interactiveBuffer, $expect);
$pos = strpos($this->interactiveBuffer, $match);
if ($pos !== false) {
return $this->_string_shift($this->interactiveBuffer, $pos + strlen($expect));
return $this->_string_shift($this->interactiveBuffer, $pos + strlen($match));
}
$response = $this->_get_channel_packet(NET_SSH2_CHANNEL_SHELL);