From 6309f5a70aec62f8426dcf6b7a8e86802c646716 Mon Sep 17 00:00:00 2001 From: Jim Wigginton Date: Mon, 5 Mar 2012 03:13:09 +0000 Subject: [PATCH] - 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 --- phpseclib/Net/SSH2.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 17e490cd..1f6378a0 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -1810,7 +1810,7 @@ class Net_SSH2 { * @return String * @access public */ - function read($expect, $mode = NET_SSH2_READ_SIMPLE) + function read($expect = '', $mode = NET_SSH2_READ_SIMPLE) { $this->curTimeout = $this->timeout; @@ -1830,7 +1830,7 @@ class Net_SSH2 { preg_match($expect, $this->interactiveBuffer, $matches); $match = $matches[0]; } - $pos = strpos($this->interactiveBuffer, $match); + $pos = !empty($match) ? strpos($this->interactiveBuffer, $match) : false; if ($pos !== false) { return $this->_string_shift($this->interactiveBuffer, $pos + strlen($match)); }