Skip to content

Commit

Permalink
SFTP: if /path/to/file is a file then /path/to/file/whatever errors
Browse files Browse the repository at this point in the history
  • Loading branch information
terrafrost committed May 11, 2020
1 parent bcaa494 commit ef9785d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions phpseclib/Net/SFTP.php
Expand Up @@ -1257,6 +1257,9 @@ function _remove_from_stat_cache($path)
$temp = &$this->stat_cache;
$max = count($dirs) - 1;
foreach ($dirs as $i => $dir) {
if (!is_array($temp)) {
return false;
}
if ($i === $max) {
unset($temp[$dir]);
return true;
Expand All @@ -1283,6 +1286,9 @@ function _query_stat_cache($path)

$temp = &$this->stat_cache;
foreach ($dirs as $dir) {
if (!is_array($temp)) {
return null;
}
if (!isset($temp[$dir])) {
return null;
}
Expand Down

1 comment on commit ef9785d

@terrafrost
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1475

Please sign in to comment.