diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-03-07 00:40:47 +0000 |
---|---|---|
committer | brian m. carlson <sandals@crustytoothpaste.net> | 2017-03-07 00:40:47 +0000 |
commit | a20fef5d2eb411bf70ebe44f42417dfb7bd6fe3a (patch) | |
tree | 2430e261da1a02367566768610ecab8d2e4d6640 | |
parent | 425ddf01a34695129bc60332ce139ce12c413f80 (diff) | |
download | perl-libnet-a20fef5d2eb411bf70ebe44f42417dfb7bd6fe3a.tar.gz |
Treat FTP MLSD commands case-insensitively
RFC 3659 states that MLSD fact names and facts are case-insensitive. While most FTP servers prefer lowercase, some choose to use mixed-case, so match MLSD data case-insensitively.
-rw-r--r-- | lib/Net/FTP.pm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Net/FTP.pm b/lib/Net/FTP.pm index 4c73647..50a071d 100644 --- a/lib/Net/FTP.pm +++ b/lib/Net/FTP.pm @@ -670,7 +670,7 @@ sub rmdir { # Try to delete the contents # Get a list of all the files in the directory, excluding the current and parent directories - my @filelist = map { /^(?:\S+;)+ (.+)$/ ? ($1) : () } grep { !/^(?:\S+;)*type=[cp]dir;/ } $ftp->_list_cmd("MLSD", $dir); + my @filelist = map { /^(?:\S+;)+ (.+)$/ ? ($1) : () } grep { !/^(?:\S+;)*type=[cp]dir;/i } $ftp->_list_cmd("MLSD", $dir); # Fallback to using the less well-defined NLST command if MLSD fails @filelist = grep { !/^\.{1,2}$/ } $ftp->ls($dir) |