Skip to content
Snippets Groups Projects
Commit f4a32617 authored by Arthur Schiwon's avatar Arthur Schiwon
Browse files

fix foldersize check to validate zip input size

parent 2ae1ad23
No related branches found
No related tags found
No related merge requests found
......@@ -212,12 +212,18 @@ class OC_Files {
$zipLimit = OC_Config::getValue('maxZipInputSize', OC_Helper::computerFileSize('800 MB'));
if ($zipLimit > 0) {
$totalsize = 0;
if (is_array($files)) {
foreach ($files as $file) {
$totalsize += \OC\Files\Filesystem::filesize($dir . '/' . $file);
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);
}
} else {
$totalsize += \OC\Files\Filesystem::filesize($dir . '/' . $files);
}
if ($totalsize > $zipLimit) {
$l = OC_L10N::get('lib');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment