From b4bffad99ab169b5a6bbb7ef0b2cfb7d60e37173 Mon Sep 17 00:00:00 2001
From: Vincent Petry <pvince81@owncloud.com>
Date: Thu, 17 Oct 2013 15:29:22 +0200
Subject: [PATCH] Fixed zip download button for unlimited filesize in public
 mode

Added missing condition to check whenever allowed zip size is unlimited.

Fixes #3717
---
 apps/files_sharing/public.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 8bdbc8524e..3d02227cb0 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -234,8 +234,9 @@ if (isset($path)) {
 			$folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
 			$folder->assign('usedSpacePercent', 0);
 			$tmpl->assign('folder', $folder->fetchPage());
+			$maxInputFileSize = OCP\Config::getSystemValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB'));
 			$allowZip = OCP\Config::getSystemValue('allowZipDownload', true)
-						&& $totalSize <= OCP\Config::getSystemValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB'));
+						&& ( $maxInputFileSize === 0 || $totalSize <= $maxInputFileSize);
 			$tmpl->assign('allowZipDownload', intval($allowZip));
 			$tmpl->assign('downloadURL',
 				OCP\Util::linkToPublic('files') . $urlLinkIdentifiers . '&download&path=' . urlencode($getPath));
-- 
GitLab