Mantis - Quercus
Viewing Issue Advanced Details
3765 major always 11-16-09 15:00 06-21-12 00:57
dobes_vandermeer  
nam  
normal  
closed 4.0.0  
fixed  
none    
none  
0003765: WordPress plugin installation corrupts or truncates larger files
This is in the version of quercus included with resin 4.0.1.

In Quercus some plugins cannot be installed because some files are corrupted when they are extracted from the plugin ZIP file.

The issue seems to be that the PclZip class they are using to extract files does not work in Quercus.

For example if I install WordPress 2.8.6 and use the "Add New Plugin" feature to search for, install, and activate the "Flutter" plugin, several of the files are truncated.

This seems related to two things:

1. fread() isn't returning the full length of data requested
2. Concatenating the results of several calls to fread() together into a string and passing that to gzinflate results in corrupt/invalid output.

Part 1 I reported elsewhere and I subsequently fixed the code in WordPress' PclZip library to call fread() until it got all the data it asked for. Unfortunately, the resulting string doesn't decompress correctly - everything after the first read()'s result is garbled. I suspect this may be related to the fact that we're working with binary data, and so this may reveal some incompatibility between the way Quercus is handling binary data in strings and the way PHP handles them.


Notes
(0004297)
dobes_vandermeer   
11-16-09 16:59   
The only successful workaround so far is to not use that updater but to manually get the zip file and unzip it yourself.

I did try changing their unzip method to use the PHP built-in zip method (zip_open(), zip_read(), etc..) but that one doesn't seem to be working properly; I've filed a bug separately reporting the bug in the zip_*() functions.
(0004299)
dobes_vandermeer   
11-16-09 20:57   
See http://bugs.caucho.com/view.php?id=3767 [^] for a new version of unzip_file and supporting java code that extracts a ZIP file somewhere. This got the install feature working for me.
(0005463)
timowest   
08-25-11 03:53   
Any chance to get this fixed soon?

Wordpress is advertised as a supported application, but a simple task like theme installation doesn't work because ZIP support is broken?
(0005912)
nam   
06-21-12 00:57   
php/1v0z

Fixed for 4.0.29.