diff --git a/src/PhpWord/Shared/ZipArchive.php b/src/PhpWord/Shared/ZipArchive.php index bc71e74b..6517ca8a 100644 --- a/src/PhpWord/Shared/ZipArchive.php +++ b/src/PhpWord/Shared/ZipArchive.php @@ -133,6 +133,13 @@ class ZipArchive if (!$this->usePclzip) { $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); // Scrutizer will report the property numFiles does not exist