Invalid Archive. Theme Install Failed. Caused by ftp_rawlist using -a option
|Reported by:||frankindelicato||Owned by:||dd32|
Downloading any theme gives me this error:
Unpacking the package.
Installing the theme.
Theme Install Failed.
I am running Mac OS X 10.6 using both MAMP and Apple Servers. The problem was found in the Worpress-MU code but the error is also in Wordpress.
The problem was traced to the @ftp_rawlist call in the function dirlist() in the class file class-wp-filesystem-ftpext.php. The @ftp_rawlist call preforms an ftp LIST command and is supposed to return a listing of a directories contents, including any folders in the directory. It was returning a boolean false instead of an array of file/folder listings.
It is fixed by removing the -a in the ftp_rawlist call.
The old line of code reads:
$list = @ftp_rawlist($this->link, '-a ' . $path, false);
The new line of code should read:
$list = @ftp_rawlist($this->link, $path, false);
Removing the -a does not effect the functionality of the dirlist() function because a few lines further down in the code the "." and ".." files/folders are ignored anyway.
The issue was discussed in the wordpress-mu forum, in the topic:
This bug is also related to the ticket: #10060
Change History (18)
- Milestone changed from Unassigned to 3.0
- Owner set to dd32
- Status changed from new to assigned
comment:13 @dd32 — 5 years ago
- Component changed from General to Filesystem
- Severity changed from blocker to major