Skip to content
Snippets Groups Projects
Unverified Commit 2b192e70 authored by Christoph Wurst's avatar Christoph Wurst Committed by GitHub
Browse files

Merge pull request #22535 from nextcloud/fix/zipstreamer_external_storage

Only disable zip64 if the size is known
parents f32c84a2 ab6bd79c
No related branches found
No related tags found
No related merge requests found
......@@ -76,8 +76,12 @@ class Streamer {
* would still be possible to create an invalid zip32 file (for example,
* a zip file from files smaller than 4GB with a central directory
* larger than 4GiB), but it should not happen in the real world.
*
* We also have to check for a size above 0. As negative sizes could be
* from not fully scanned external storages. And then things fall apart
* if somebody tries to package to much.
*/
if ($size < 4 * 1000 * 1000 * 1000 && $numberOfFiles < 65536) {
if ($size > 0 && $size < 4 * 1000 * 1000 * 1000 && $numberOfFiles < 65536) {
$this->streamerInstance = new ZipStreamer(['zip64' => false]);
} elseif ($request->isUserAgent($this->preferTarFor)) {
$this->streamerInstance = new TarStreamer();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment