diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index e63f1c1a..21391848 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -1516,11 +1516,8 @@ class Net_SFTP extends Net_SSH2 return false; } + unset($entries['.'], $entries['..']); foreach ($entries as $filename=>$props) { - if ($filename == '.' || $filename == '..') { - continue; - } - if (!isset($props['type'])) { return false; } @@ -2148,11 +2145,8 @@ class Net_SFTP extends Net_SSH2 return false; } + unset($entries['.'], $entries['..']); foreach ($entries as $filename=>$props) { - if ($filename == '.' || $filename == '..') { - continue; - } - if (!isset($props['type'])) { return false; }