From 84a9a300d453d645c45f004ef5f0ada66a210bd5 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 24 Jul 2014 11:00:55 +0200 Subject: [PATCH] Do not check filename over and over again, remove '.' and '..' from the map instead. --- phpseclib/Net/SFTP.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index d7151b58..0fc586f9 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; } @@ -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; }