From 57ef089aac11f66f7cb29e9de1cb1e7d7bb46058 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 2 Jun 2014 16:29:03 +0200 Subject: drop allowZIPdownload and maxZIPSize as options --- lib/private/files.php | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) (limited to 'lib/private/files.php') diff --git a/lib/private/files.php b/lib/private/files.php index 7c437a16a98..739dae64180 100644 --- a/lib/private/files.php +++ b/lib/private/files.php @@ -108,7 +108,6 @@ class OC_Files { $xsendfile = false; } } else { - self::validateZipDownload($dir, $files); $zip = new ZipStreamer(false); } OC_Util::obEnd(); @@ -221,53 +220,6 @@ class OC_Files { } } - /** - * checks if the selected files are within the size constraint. If not, outputs an error page. - * - * @param string $dir - * @param array|string $files - */ - static function validateZipDownload($dir, $files) { - if (!OC_Config::getValue('allowZipDownload', true)) { - $l = OC_L10N::get('lib'); - header("HTTP/1.0 409 Conflict"); - OC_Template::printErrorPage( - $l->t('ZIP download is turned off.'), - $l->t('Files need to be downloaded one by one.') - . '
' . $l->t('Back to Files') . '' - ); - exit; - } - - $zipLimit = OC_Config::getValue('maxZipInputSize', OC_Helper::computerFileSize('800 MB')); - if ($zipLimit > 0) { - $totalsize = 0; - if(!is_array($files)) { - $files = array($files); - } - foreach ($files as $file) { - $path = $dir . '/' . $file; - if(\OC\Files\Filesystem::is_dir($path)) { - foreach (\OC\Files\Filesystem::getDirectoryContent($path) as $i) { - $totalsize += $i['size']; - } - } else { - $totalsize += \OC\Files\Filesystem::filesize($path); - } - } - if ($totalsize > $zipLimit) { - $l = OC_L10N::get('lib'); - header("HTTP/1.0 409 Conflict"); - OC_Template::printErrorPage( - $l->t('Selected files too large to generate zip file.'), - $l->t('Please download the files separately in smaller chunks or kindly ask your administrator.') - . '
' . $l->t('Back to Files') . '' - ); - exit; - } - } - } - /** * set the maximum upload size limit for apache hosts using .htaccess * -- cgit v1.2.3