mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-28 12:10:59 +00:00
SFTP_Stream: fix errors when context isn't defined
This commit is contained in:
parent
df45abcda0
commit
bf6d1bc253
@ -159,10 +159,12 @@ class Net_SFTP_Stream {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($this->context)) {
|
||||||
$context = stream_context_get_params($this->context);
|
$context = stream_context_get_params($this->context);
|
||||||
if (isset($context['notification'])) {
|
if (isset($context['notification'])) {
|
||||||
$this->notification = $context['notification'];
|
$this->notification = $context['notification'];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($host[0] == '$') {
|
if ($host[0] == '$') {
|
||||||
$host = substr($host, 1);
|
$host = substr($host, 1);
|
||||||
@ -172,7 +174,9 @@ class Net_SFTP_Stream {
|
|||||||
}
|
}
|
||||||
$this->sftp = $$host;
|
$this->sftp = $$host;
|
||||||
} else {
|
} else {
|
||||||
|
if (isset($this->contenxt)) {
|
||||||
$context = stream_context_get_options($this->context);
|
$context = stream_context_get_options($this->context);
|
||||||
|
}
|
||||||
if (isset($context['sftp']['session'])) {
|
if (isset($context['sftp']['session'])) {
|
||||||
$sftp = $context['sftp']['session'];
|
$sftp = $context['sftp']['session'];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user