[wp-trac] [WordPress Trac] #52018: Zip Module 2.8.2 - class-pclzip fatal error with PHP 8.0

WordPress Trac noreply at wordpress.org
Sun Dec 27 14:30:41 UTC 2020


#52018: Zip Module 2.8.2 - class-pclzip fatal error with PHP 8.0
---------------------------------------------+---------------------
 Reporter:  fierevere                        |       Owner:  (none)
     Type:  defect (bug)                     |      Status:  new
 Priority:  normal                           |   Milestone:  5.6.1
Component:  Filesystem API                   |     Version:  5.6
 Severity:  normal                           |  Resolution:
 Keywords:  php8 has-patch needs-unit-tests  |     Focuses:
---------------------------------------------+---------------------
Changes (by jrf):

 * keywords:  php8 has-patch => php8 has-patch needs-unit-tests


Comment:

 Thank you @fierevere for reporting this and adding an initial patch.

 I've reviewed the patch and I don't think it's ready.

 1. The `privExtractFileAsString()` gets passed all parameters by reference
 - `&$p_entry, &$p_string, &$p_options` -, but the parameter types are not
 documented.
 2. The current patch changes the parameter type for `$p_string` from
 `string` to `bool`. While this is also done on failure by the call to
 `fread()` this makes the method unstable and could cause unintended side-
 effects.
 3. With this in mind, this change would really need to be accompanied by
 unit tests, preferably quite extensive ones which also verify that
 changing the type of `$p_string` does not negatively impact other
 functions calling `privExtractFileAsString()`.

 As this is an external library which is no longer maintained and for which
 I cannot find any tests at all in the current test suite, I wonder if it
 may be time to look for an (external) replacement library for this
 functionality. While such an effort should be addressed in a separate
 ticket, it may influence how much effort should be put into fixing the
 current issue.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/52018#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list