Skip to content

Commit 6a26a2c

Browse files
ENGCOM-8549: Fix ftp_nlist for empty folders returns false #31308
- Merge Pull Request #31308 from Nazar65/magento2:fix_ls_method_of_ftp - Merged commits: 1. 5559a51 2. c42d022
2 parents 1c3837c + c42d022 commit 6a26a2c

File tree

1 file changed

+2
-1
lines changed
  • lib/internal/Magento/Framework/Filesystem/Io

1 file changed

+2
-1
lines changed

lib/internal/Magento/Framework/Filesystem/Io/Ftp.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ public function chmod($filename, $mode)
313313
*/
314314
public function ls($grep = null)
315315
{
316-
$ls = @ftp_nlist($this->_conn, '.');
316+
$ls = @ftp_nlist($this->_conn, '.') ?: [];
317317

318318
$list = [];
319+
319320
foreach ($ls as $file) {
320321
$list[] = ['text' => $file, 'id' => $this->pwd() . '/' . $file];
321322
}

0 commit comments

Comments
 (0)