1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-11-30 04:39:21 +01:00

Do not check filename over and over again, remove '.' and '..' from the map instead.

This commit is contained in:
Andreas Fischer 2014-07-24 11:00:55 +02:00
parent a0a23cbaf1
commit 84a9a300d4

View File

@ -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;
}
@ -2146,11 +2143,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;
}