[wp-trac] [WordPress Trac] #54036: PclZip throwing errors on PHP 8 - previously merged patch is incomplete

WordPress Trac noreply at wordpress.org
Mon Aug 30 14:28:03 UTC 2021


#54036: PclZip throwing errors on PHP 8 - previously merged patch is incomplete
----------------------------------------+-----------------------------
 Reporter:  DavidAnderson               |       Owner:  SergeyBiryukov
     Type:  defect (bug)                |      Status:  closed
 Priority:  normal                      |   Milestone:  5.8.1
Component:  Filesystem API              |     Version:  trunk
 Severity:  normal                      |  Resolution:  fixed
 Keywords:  php8 has-patch fixed-major  |     Focuses:
----------------------------------------+-----------------------------
Changes (by desrosj):

 * status:  reopened => closed
 * resolution:   => fixed


Comment:

 In [changeset:"51694" 51694]:
 {{{
 #!CommitTicketReference repository="" revision="51694"
 Filesystem API: Make sure to only call `fread()` on non-empty files in
 `PclZip::privAddFile()`.

 This avoids a fatal error on PHP 8 caused by passing a zero value to
 `fread()` as the `$length` argument, which must be greater than zero.

 This commit also amends the previous solution for similar issues elsewhere
 in the file to ensure consistent type for string values, instead of
 changing the type from `string` to `bool` when trying to read from an
 empty file.

 Follow-up to [50355].

 Props DavidAnderson, jrf, SergeyBiryukov.
 Merges [51686] to the 5.8 branch.
 Fixes #54036.
 }}}

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


More information about the wp-trac mailing list