diff --git a/phpseclib/Net/SSH2.php b/phpseclib/Net/SSH2.php index 2a4ebe45..b47cfe5c 100644 --- a/phpseclib/Net/SSH2.php +++ b/phpseclib/Net/SSH2.php @@ -3533,7 +3533,11 @@ class Net_SSH2 if (!is_resource($this->fsock) || feof($this->fsock)) { $this->bitmap = 0; - user_error('Connection closed (by server) prematurely ' . $elapsed . 's'); + $str = 'Connection closed (by server) prematurely'; + if (isset($elapsed)) { + $str.= ' ' . $elapsed . 's'; + } + user_error($str); return false; }