From 900e6aaf020940848eca2e05c729e89ad570c936 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 23 Aug 2022 15:33:38 +0200 Subject: [PATCH] Code comment --- htdocs/ftp/index.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index bbf01bb4fbe..13090e2e539 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -492,14 +492,30 @@ if (!function_exists('ftp_connect')) { //$newsection = '/./'; $newsection = ssh2_sftp_realpath($conn_id, ".").'/./'; // workaround for bug https://bugs.php.net/bug.php?id=64169 } + //$newsection='/'; //$dirHandle = opendir("ssh2.sftp://$conn_id".$newsection); //$dirHandle = opendir("ssh2.sftp://".intval($conn_id).ssh2_sftp_realpath($conn_id, ".").'/./'); + $contents = scandir('ssh2.sftp://'.intval($conn_id).$newsection); $buff = array(); foreach ($contents as $i => $key) { $buff[$i] = "---------- - root root 1234 Aug 01 2000 ".$key; } + + //$i = 0; + //$handle = opendir('ssh2.sftp://'.intval($conn_id).$newsection); + //$buff=array(); + //while (false !== ($file = readdir($handle))) { + // if (substr("$file", 0, 1) != "."){ + // if (is_dir($file)) { + // $buff[$i]="d--------- - root root 1234 Aug 01 2000 ".$file; + // } else { + // $buff[$i]="---------- - root root 1234 Aug 01 2000 ".$file; + // } + // } + // $i++; + //} } else { $buff = ftp_rawlist($conn_id, $newsectioniso); $contents = ftp_nlist($conn_id, $newsectioniso); // Sometimes rawlist fails but never nlist