Skip to content

Commit

Permalink
ENGCOM-8549: Fix ftp_nlist for empty folders returns false #31308
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrieldagama authored Jan 6, 2021
2 parents d401676 + 6a26a2c commit 6602482
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/Magento/Framework/Filesystem/Io/Ftp.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,10 @@ public function chmod($filename, $mode)
*/
public function ls($grep = null)
{
$ls = @ftp_nlist($this->_conn, '.');
$ls = @ftp_nlist($this->_conn, '.') ?: [];

$list = [];

foreach ($ls as $file) {
$list[] = ['text' => $file, 'id' => $this->pwd() . '/' . $file];
}
Expand Down

0 comments on commit 6602482

Please sign in to comment.