1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-04 18:48:24 +01:00

SFTP_Stream: fix errors when context isn't defined

This commit is contained in:
terrafrost 2013-08-28 13:55:14 -05:00
parent df45abcda0
commit bf6d1bc253

View File

@ -159,9 +159,11 @@ class Net_SFTP_Stream {
return false;
}
$context = stream_context_get_params($this->context);
if (isset($context['notification'])) {
$this->notification = $context['notification'];
if (isset($this->context)) {
$context = stream_context_get_params($this->context);
if (isset($context['notification'])) {
$this->notification = $context['notification'];
}
}
if ($host[0] == '$') {
@ -172,7 +174,9 @@ class Net_SFTP_Stream {
}
$this->sftp = $$host;
} else {
$context = stream_context_get_options($this->context);
if (isset($this->contenxt)) {
$context = stream_context_get_options($this->context);
}
if (isset($context['sftp']['session'])) {
$sftp = $context['sftp']['session'];
}