Merge pull request #2193 from garethellis36/2187-php8.1-deprecation

#2187 Addresses deprecation on PHP 8.1 in ZipArchi
This commit is contained in:
Adrien Crivelli 2022-02-17 16:35:57 +01:00 committed by GitHub
commit 01d87e17fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -133,6 +133,13 @@ class ZipArchive
if (!$this->usePclzip) { if (!$this->usePclzip) {
$zip = new \ZipArchive(); $zip = new \ZipArchive();
// PHP 8.1 compat - passing null as second arg to \ZipArchive::open() is deprecated
// passing 0 achieves the same behaviour
if ($flags === null) {
$flags = 0;
}
$result = $zip->open($this->filename, $flags); $result = $zip->open($this->filename, $flags);
// Scrutizer will report the property numFiles does not exist // Scrutizer will report the property numFiles does not exist