about summary refs log tree commit
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-03-07 00:40:47 +0000
committerbrian m. carlson <sandals@crustytoothpaste.net>2017-03-07 00:40:47 +0000
commita20fef5d2eb411bf70ebe44f42417dfb7bd6fe3a (patch)
tree2430e261da1a02367566768610ecab8d2e4d6640
parent425ddf01a34695129bc60332ce139ce12c413f80 (diff)
downloadperl-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.pm2
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)