mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-02-14 17:46:28 +00:00
SFTP: if /path/to/file is a file then /path/to/file/whatever errors
This commit is contained in:
parent
bcaa494af2
commit
ef9785d9c5
@ -1257,6 +1257,9 @@ class Net_SFTP extends Net_SSH2
|
|||||||
$temp = &$this->stat_cache;
|
$temp = &$this->stat_cache;
|
||||||
$max = count($dirs) - 1;
|
$max = count($dirs) - 1;
|
||||||
foreach ($dirs as $i => $dir) {
|
foreach ($dirs as $i => $dir) {
|
||||||
|
if (!is_array($temp)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if ($i === $max) {
|
if ($i === $max) {
|
||||||
unset($temp[$dir]);
|
unset($temp[$dir]);
|
||||||
return true;
|
return true;
|
||||||
@ -1283,6 +1286,9 @@ class Net_SFTP extends Net_SSH2
|
|||||||
|
|
||||||
$temp = &$this->stat_cache;
|
$temp = &$this->stat_cache;
|
||||||
foreach ($dirs as $dir) {
|
foreach ($dirs as $dir) {
|
||||||
|
if (!is_array($temp)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (!isset($temp[$dir])) {
|
if (!isset($temp[$dir])) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user