From b04d17f011e7cfe68551de2f792dc0eef4b62cdb Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 19 Feb 2008 08:22:42 +0000 Subject: [PATCH] Fix ftpext dirlist for ftp servers that return 8 fields instead of 9. see #5586 git-svn-id: http://svn.automattic.com/wordpress/trunk@6914 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-wp-filesystem-ftpext.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/class-wp-filesystem-ftpext.php b/wp-admin/includes/class-wp-filesystem-ftpext.php index 528b0d0d35..b0cfbf7e7f 100644 --- a/wp-admin/includes/class-wp-filesystem-ftpext.php +++ b/wp-admin/includes/class-wp-filesystem-ftpext.php @@ -363,8 +363,9 @@ class WP_Filesystem_FTPext{ foreach($list as $line){ if (substr(strtolower($line), 0, 5) == 'total') continue; $struc = array(); - $current = preg_split("/[\s]+/",$line,9); - $struc['name'] = str_replace('//','',$current[8]); + $current = preg_split("/[\s]+/",$line,9); + $name_num = count($current) - 1; + $struc['name'] = str_replace('//','',$current[$name_num]); if( '.' == $struc['name'][0] && !$incdot) continue; @@ -398,6 +399,7 @@ class WP_Filesystem_FTPext{ //File $ret[$struc['name']] = $struc; } + return $ret; } function __destruct(){ if( $this->link )