ftp_list.php support ftp output with fewer fields

Version 1.51

Bugfix
Finished

The ftp_list.php was originally expecting ftp servers to output something like this: -rwxr-xr-x 1 admin admin 503 Mar 3 2016 file1.txt -rw-r--r-- 1 admin admin 1028 Aug 8 2015 file2.txt -rwxr--r-- 1 admin admin 5747 Sep 14 2012 file3.txt But some ftp servers might output: 05-03-16 05:16PM 503 file1.txt 08-08-16 05:16PM 1028 file2.txt 09-14-16 05:16PM 5747 file3.txt which confuses the parser. The ftp_list.php has been chanegd to use the awk NF variable to count the number of fields. Regardless of the number of fields, awk will now output only the last value. Although we could use -1 with nftpls or --list-only with curl, because we want to parse out the directories, we need the full output.

Interested to try DirectAdmin? Get a 30-day Free Trial!