SSH2: fix possibly undefined variable error

This commit is contained in:
terrafrost 2022-06-14 00:02:10 -05:00
parent 57c4f216d6
commit 62677de0bf

View File

@ -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;
}