From 8ce392f21879d6d255a5b064e7ea99f69472fa34 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 16 Mar 2019 09:41:06 -0500 Subject: [PATCH] SFTP: nlist() didn't return empty directories - now it does I view this as a BC breaking change so atm do not plan on backporting it to 1.0/2.0. eg. now, all subdirectories have . and .. as "files" whereas before they didn't --- phpseclib/Net/SFTP.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/phpseclib/Net/SFTP.php b/phpseclib/Net/SFTP.php index 8f22632b..5503228a 100644 --- a/phpseclib/Net/SFTP.php +++ b/phpseclib/Net/SFTP.php @@ -837,9 +837,7 @@ class SFTP extends SSH2 $result = []; foreach ($files as $value) { if ($value == '.' || $value == '..') { - if ($relativeDir == '') { - $result[] = $value; - } + $result[] = $relativeDir . $value; continue; } if (is_array($this->query_stat_cache($this->realpath($dir . '/' . $value)))) {