Make WordPress Core

Opened 14 years ago

Closed 8 years ago

Last modified 5 years ago

#15440 closed defect (bug) (wontfix)

PCLZIP_ERR_BAD_FORMAT (-10) : Invalid archive structure during plugin update

Reported by: longtail-video's profile LongTail Video Owned by:
Milestone: Priority: low
Severity: normal Version: 3.0.1
Component: Upgrade/Install Keywords: needs-patch
Focuses: Cc:


Currently, as part of our JW Player plugin we include several player skins so that users can customize the look of the JW Player. These skins are packaged as zip archives.

For a while now we've been getting reports from our users having difficulty performing the automated update/install. These users are receiving a PCLZIP error which claims the plugin archive is invalid.

From looking at the source code I see that WordPress first attempts to use the ZipArchive PHP module to unzip plugin packages. This always works for users updating our plugin. If this is not available it then uses a fallback library called PCLZIP. After some experimentation, it seems that PCLZIP has difficulty unzipping archives that contain archives.

Is this a known issue from your experience? If so, is there a workaround other than removing the zip skins from our plugin package?

Change History (9)

#1 @nacin
14 years ago

Nesting archives typically isn't a good idea.

#2 @hakre
14 years ago

Thanks for reporting the issue. Can you confirm that this is reproduce-able every time when PCLZIP extracts a zip-file containing another zip?

Technically there should be no difference which type of files reside inside a zip. I don't know why this should be a bad idea to have a zip in a zip technically. I never had problems with that on desktop or shell, so if this actually happens every time with PCLZIP (and not the PHP ZIP extenstion), this is most likely a flaw with PCLZIP (as this is a PCLZIP error constant). I couldn't find any information if zip in zip is problematic on the PCLZIP homepage.

If this is reproduceable, it's probably worth to check if WP still has the latest PCLZIP version bundled and to report this problem as well to the PCLZIP project.

#3 @LongTail Video
14 years ago

Thanks for the response. I have no problem actually reproducing this issue. I looked into the PCLZIP version and from what I can tell WordPress is using the latest version.

I'll look into reporting the issue to the PCLZIP project.

#4 @dd32
13 years ago

  • Component changed from General to Upgrade/Install
  • Keywords needs-patch external added
  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to low

Just Triag'ing the ticket, Setting Priority to low, only due to the complexity of PclZip and the limited impact (A small percentage of plugins will use zip's in their zip's)

#5 @dd32
13 years ago

Can duplicate this issue with this file: however, I cant duplicate it with a simple archive within an archive however, so it might be dependant on archive in a subfolder, or a particular compression application used by or maybe the size of the archives.

Looking at the strings within PclZip, it appears as if it thinks some files finish half way through, which causes a problem(Invalid archive structure) when it can't find the next file header mid-way through the compressed file data.. Unfortnately, I'm not good enough to follow some of the cryptics within PclZip, but it looks like privReadEndCentralDir() might be returning the incorrect offsets (Note, This is the function we had to patch for 64bit systems when initially introduced)

#6 @chriscct7
10 years ago

  • Keywords external removed
  • Severity changed from normal to minor

#7 @chriscct7
8 years ago

  • Severity changed from minor to normal

#8 @dd32
8 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

5 years later, we're not getting reports of this, and I suspect the PHP Zip extension is used more often (but we have no stats).

Nested Zips is a bad idea, i'm sure there are some cases where it's useful, but realistically WordPress nor Browsers should be reading a zip file.. so I'm going to mark this as wontfix.

This ticket was mentioned in Slack in #core-editor by talldanwp. View the logs.

5 years ago

Note: See TracTickets for help on using tickets.