diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2014-06-02 16:29:03 +0200 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2014-06-02 16:29:03 +0200 |
commit | 57ef089aac11f66f7cb29e9de1cb1e7d7bb46058 (patch) | |
tree | d68c62c5ee4c29cedc14756168e627356d9e914b /lib/private/files.php | |
parent | 6f4bdbdb9495227c1ad1bf170ad9caeddea127c7 (diff) | |
download | nextcloud-server-57ef089aac11f66f7cb29e9de1cb1e7d7bb46058.tar.gz nextcloud-server-57ef089aac11f66f7cb29e9de1cb1e7d7bb46058.zip |
drop allowZIPdownload and maxZIPSize as options
Diffstat (limited to 'lib/private/files.php')
-rw-r--r-- | lib/private/files.php | 48 |
1 files changed, 0 insertions, 48 deletions
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(); @@ -222,53 +221,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.') - . '<br/><a href="'.OCP\Util::linkTo('files', 'index.php', array('dir' => $dir)).'">' . $l->t('Back to Files') . '</a>' - ); - 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.') - . '<br/><a href="'.OCP\Util::linkTo('files', 'index.php', array('dir' => $dir)).'">' . $l->t('Back to Files') . '</a>' - ); - exit; - } - } - } - - /** * set the maximum upload size limit for apache hosts using .htaccess * * @param int $size file size in bytes |