Ticket #6236 (closed defect: fixed)

Opened 4 months ago

Last modified 3 months ago

Platform independence issues with the pclzip class

Reported by: westi Assigned to: westi
Priority: normal Milestone: 2.5
Component: General Version: 2.5
Severity: blocker Keywords: upstream
Cc:

Description

This relates to #5586 but is worthy of it's own ticket.

From DD32 on wp-testers:

PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature

Unfortunately, Its something which i dont know how to work around, It appears to be > that the Zip class in use doesnt work 100% under certain web hosters setups..

I tracked it down to a small section of code, some Binary maths, Which makes no sense to me, All i could tell, was that there was a chance that the integer was reaching its maximum size or something (in other words) not much).

I'm using PHP 5.0.5 on the host affected by my bug.

From further investigation with DD32 it seems that some of the code in pclzip assumes that it is working with 32bit numbers.

This ticket is for us to work on resolving these issues.

Change History

03/15/08 18:17:11 changed by westi

  • owner changed from anonymous to westi.
  • status changed from new to assigned.

03/15/08 18:33:16 changed by westi

(In [7314]) Chase down some 64bit dragons. Ensure that we only ever create a 32bit number to compare to the 32bit magic number when searching a zip file for the end of the directory record. See #6236.

(follow-up: ↓ 4 ) 03/15/08 23:26:20 changed by DD32

Commit has fixed the issues on my server setup :)

Cheers for your knowledge westi :P

(in reply to: ↑ 3 ) 03/15/08 23:30:51 changed by westi

  • keywords set to upstream.

Replying to DD32:

Commit has fixed the issues on my server setup :)

Cool. I will send this upstream

03/16/08 14:41:39 changed by dougal

I'm currently getting this (in r7331):

Fatal error: Call to a member function exists() on a non-object in path.../wp-admin/includes/class-wp-filesystem-ftpsockets.php on line 110

Declaring the $wp_filesystem variable as a global in the find_base_dir() method seems to fix that error. But: 1) The update seems to be slow as molasses on my system, and 2) I'm still getting zero-byte files during the unzip stage.

Are the built-in zip functions being used, when available? My system is PHP 5.2.1 with the ZIP extension installed.

And I still think this either needs to use AJAX, or we should put some flush() calls at various key points of the upgrade. There needs to be some sort of user feedback for slow updates, or users are going to be punching the "stop" button in their browsers, thinking that something has stalled.

03/16/08 18:18:36 changed by ryan

(In [7334]) Fix var name. see #6236

03/16/08 18:19:43 changed by ryan

(In [7335]) Fix var name. see #6236

03/16/08 18:20:31 changed by ryan

Flushing can be added to show_message() in wp-admin/update.php

03/16/08 23:41:50 changed by DD32

Are the built-in zip functions being used, when available? My system is PHP 5.2.1 with the ZIP extension installed.

Not yet, And probably not in this release, but i'd like it to be used if available, but not many people have it enabled.

And I still think this either needs to use AJAX, or we should put some flush() calls at various key points of the upgrade. There needs to be some sort of user feedback for slow updates, or users are going to be punching the "stop" button in their browsers, thinking that something has stalled.

If the webserver has an output buffer running, then theres nothing that can force it to flush out the page until its fully loaded, I've come accross it on Dreamhost, even adding some flushes didnt help.

However, On other servers without a forced output buffer, then the messages are shown as they happen.

Ajax wouldnt be possible in this situation, It'd simply make the output appear in one hit, rather than in small chunks. Someone suggested using HTTP Continues to load the page with one message, then in the same script execution, load the next "page" (but its the same page just with extra messages), But i've not a clue how to do that.

2) I'm still getting zero-byte files during the unzip stage.

Looking at the debug output you sent me, and its writing files correctly, Or at least the test file is, But aparantly not extracting properly for some reason.. i'll send back some small changes and see what that gives.

03/29/08 22:08:51 changed by westi

  • status changed from assigned to closed.
  • resolution set to fixed.
  • milestone changed from 2.6 to 2.5.

Closing this as the original issue was fixed.

Please raise new tickets for any new issues.