mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-16 02:07:09 +00:00
- read() doesn't give an E_WARNING when $expect is blank
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@198 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
parent
329d3e2a15
commit
6309f5a70a
@ -1810,7 +1810,7 @@ class Net_SSH2 {
|
|||||||
* @return String
|
* @return String
|
||||||
* @access public
|
* @access public
|
||||||
*/
|
*/
|
||||||
function read($expect, $mode = NET_SSH2_READ_SIMPLE)
|
function read($expect = '', $mode = NET_SSH2_READ_SIMPLE)
|
||||||
{
|
{
|
||||||
$this->curTimeout = $this->timeout;
|
$this->curTimeout = $this->timeout;
|
||||||
|
|
||||||
@ -1830,7 +1830,7 @@ class Net_SSH2 {
|
|||||||
preg_match($expect, $this->interactiveBuffer, $matches);
|
preg_match($expect, $this->interactiveBuffer, $matches);
|
||||||
$match = $matches[0];
|
$match = $matches[0];
|
||||||
}
|
}
|
||||||
$pos = strpos($this->interactiveBuffer, $match);
|
$pos = !empty($match) ? strpos($this->interactiveBuffer, $match) : false;
|
||||||
if ($pos !== false) {
|
if ($pos !== false) {
|
||||||
return $this->_string_shift($this->interactiveBuffer, $pos + strlen($match));
|
return $this->_string_shift($this->interactiveBuffer, $pos + strlen($match));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user