[wp-trac] [WordPress Trac] #54036: PclZip throwing errors on PHP 8 - previously merged patch is incomplete
WordPress Trac
noreply at wordpress.org
Sun Aug 29 01:33:00 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.9
Component: Filesystem API | Version: trunk
Severity: normal | Resolution: fixed
Keywords: php8 has-patch | Focuses:
----------------------------+-----------------------------
Changes (by SergeyBiryukov):
* owner: (none) => SergeyBiryukov
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"51686" 51686]:
{{{
#!CommitTicketReference repository="" revision="51686"
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.
Fixes #54036.
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/54036#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list