From 4ec6dd6a4e05b69d6471b1661823e2fc66df080c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 5 Jan 2018 14:03:24 +0100 Subject: [PATCH] Patch ZipStreamer to fix directory downloads Signed-off-by: Joas Schilling --- mcnetic/zipstreamer/src/ZipStreamer.php | 2 +- patches.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mcnetic/zipstreamer/src/ZipStreamer.php b/mcnetic/zipstreamer/src/ZipStreamer.php index 18d41a61f..2a562c7da 100644 --- a/mcnetic/zipstreamer/src/ZipStreamer.php +++ b/mcnetic/zipstreamer/src/ZipStreamer.php @@ -525,7 +525,7 @@ private function buildCentralDirectoryHeader($filePath, $timestamp, $gpFlags, private function buildEndOfCentralDirectoryRecord($cdRecLength) { if ($this->zip64) { $diskNumber = -1; - $cdRecCount = -1; + $cdRecCount = min(sizeof($this->cdRec), 0xffff); $cdRecLength = -1; $offset = -1; } else { diff --git a/patches.txt b/patches.txt index ef941ca7f..154ca04ce 100644 --- a/patches.txt +++ b/patches.txt @@ -6,3 +6,4 @@ Patches: - SabreXML: Fix invalid PHP docs https://github.com/fruux/sabre-xml/pull/128 - php-opencloud: Fix invalid PHP docs https://github.com/rackspace/php-opencloud/pull/711 - SabreXML: Prevent infinite loops for empty props element https://github.com/fruux/sabre-xml/pull/132 +- ZipStreamer: Fix zip generation for 7zip https://github.com/McNetic/PHPZipStreamer/pull/39