When trying to install a module from the "Upload a module or theme archive to install" field in the "Install New Module" dialog, I'm getting the following error when I try to use /home/user/code/drupal7/views-7.x-3.x-dev.tar.gz:
For security reasons, your upload has been renamed to views-7.x-3.x-dev.tar_.gz.
Error message
Cannot extract temporary://views-7.x-3.x-dev.tar_.gz, not a valid archive.
The archive is valid, however, and can be extracted via the shell with tar -xvzf, without any problems.
I was able to fix the problem and upload the module, by renaming the file to have the extension ".tgz" before uploading. But the instructions underneath the form fields both use files with "tar.gz" extensions in the example.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | dontmungearchive.patch | 630 bytes | dhthwy |
| #1 | 801330-archive-extensions-D7.patch | 1.13 KB | Garrett Albright |
Comments
Comment #1
Garrett Albright commentedThe correct answer is to make it work with files with .tar.gz. The quick and dirty answer is to change the description text to use .tgz instead (and also fix t() abuse).
Comment #2
Garrett Albright commentedComment #3
dhthwy commentedThis is a bug. Code is already in place for it to work with tar, tgz, tar.gz, tar.bz2.
Comment #4
dhthwy commentedThe problem is that archives are being munged with file_munge_filename() and the check for valid archive extensions don't account for that. I'm assuming it is because archives are not really supposed to be munged, and I don't think they need to be munged. So here is a simple patch which adds them to the whitelist.
Comment #5
dhthwy commentedI guess this title better reflects the issue.
Comment #6
dhthwy commentedOh well, as much as I hate to do this I think this is critical since it breaks the module installer.
Comment #7
dhthwy commentedComment #8
catchThis is a duplicate of #693084: Regression: file_munge_filename() extension handling broken by move to File Field, see you in that issue hopefully.