mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-05 05:18:28 +00:00
- read(...) only returned first byte of matched string - not entire matched string
git-svn-id: http://phpseclib.svn.sourceforge.net/svnroot/phpseclib/trunk@153 21d32557-59b3-4da0-833f-c5933fad653e
This commit is contained in:
parent
392d96445e
commit
b614ab4dc0
@ -1778,15 +1778,13 @@ class Net_SSH2 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if ($mode != NET_SSH2_READ_REGEX) {
|
if ($mode == NET_SSH2_READ_REGEX) {
|
||||||
$pos = strpos($this->interactiveBuffer, $expect);
|
preg_match($expect, $this->interactiveBuffer, $matches);
|
||||||
} else {
|
$expect = $matches[0];
|
||||||
$pos = preg_match($expect, $this->interactiveBuffer, $matches) ?
|
|
||||||
strpos($this->interactiveBuffer, $matches[0]) :
|
|
||||||
false;
|
|
||||||
}
|
}
|
||||||
|
$pos = strpos($this->interactiveBuffer, $expect);
|
||||||
if ($pos !== false) {
|
if ($pos !== false) {
|
||||||
return $this->_string_shift($this->interactiveBuffer, $pos + 1);
|
return $this->_string_shift($this->interactiveBuffer, $pos + strlen($expect));
|
||||||
}
|
}
|
||||||
$response = $this->_get_channel_packet(NET_SSH2_CHANNEL_SHELL);
|
$response = $this->_get_channel_packet(NET_SSH2_CHANNEL_SHELL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user